예제 #1
0
        public static void SetFieldValue(By locator, string value)
        {
            IWebElement ele = UIReadHelper.GetVisibleElement(locator);

            if (ele != null)
            {
                ele.SendKeys(value);
            }
            else
            {
                Reporter.LogFailMassage("Unable to find element " + locator);
            }
        }
예제 #2
0
        public static void ClickOnElement(By locator)
        {
            IWebElement ele = UIReadHelper.GetVisibleElement(locator);

            if (ele != null)
            {
                ele.Click();
            }
            else
            {
                Reporter.LogFailMassage("Unable to find element " + locator);
            }
        }
예제 #3
0
        public static void SelectFieldValue(By locator, string value)
        {
            IWebElement ele = UIReadHelper.GetVisibleElement(locator);

            if (ele != null)
            {
                ele.Click();
                Thread.Sleep(2000);
                OpenQA.Selenium.Interactions.Actions curAction = new OpenQA.Selenium.Interactions.Actions(UIReadHelper.driver);
                IWebElement optionEle = driver.FindElement(By.XPath("//option[text()='" + value + "']"));
                curAction.MoveToElement(optionEle);
                //curAction.Click(optionEle).Build().Perform();
                UIReadHelper.GetVisibleElement(By.XPath("//option[text()='" + value + "']")).Click();
            }
            else
            {
                Reporter.LogFailMassage("Unable to find element " + locator);
            }
        }