Ejemplo n.º 1
0
        protected override void OnProcess(Action.IAction action)
        {
            SendKeyAction sendKeyAction = action as SendKeyAction;

            if (sendKeyAction == null)
            {
                return;
            }

            LoggerManager.Debug(action.AutomationActionData);

            HtmlElement element = this.GetData(action) as HtmlElement;

            if (element == null)
            {
                LoggerManager.Error("Element Not Found");
                throw new ElementNoFoundException("Element Not Found", action);
            }

            this.Call <HtmlElement>(delegate(HtmlElement e)
            {
                e.Focus();
                SendKey(sendKeyAction);
            }, element);
        }
Ejemplo n.º 2
0
 private void SendKey(SendKeyAction sendKeyAction)
 {
     if (sendKeyAction.Keys != null && sendKeyAction.Keys.Count > 0)
     {
         foreach (string key in sendKeyAction.Keys)
         {
             System.Windows.Forms.SendKeys.Send(key);
         }
     }
 }