Ejemplo n.º 1
0
        private IWebElement FindElement(TaskAction taskAction)
        {
            IWebElement result = null;

            WebElementHelper helper = WebElementHelper.GetInstance();

            result = _driver.FindElement(helper.getWebElementBy(taskAction.findBy, taskAction.value));

            return(result);
        }
Ejemplo n.º 2
0
        public void PerformTaskActions(TaskAction taskAction, ref IWebElement webElement)
        {
            switch (taskAction.action)
            {
            case "findElement":
                webElement = FindElement(taskAction);
                break;

            case "sendKeys":
                PerformSendKey(webElement, taskAction);
                break;

            case "click":
                PerformClick(webElement);
                break;
            }
        }
Ejemplo n.º 3
0
        private void PerformSendKey(IWebElement element, TaskAction taskAction)
        {
            try
            {
                if (element != null)
                {
                    element.SendKeys(taskAction.value);

                    if (!string.IsNullOrEmpty(taskAction.keys))
                    {
                        element.SendKeys(GetKey(taskAction.keys));
                    }
                }
            }
            catch (Exception ex)
            {
                Helpers.GetInstance().Logger.Error(ex, "Internal Error");
            }
        }