Пример #1
0
 public static void DoubleClick(By locator, int waitInSecs)
 {
     if (SeleniumVisibility.IsElementVisible(locator, waitInSecs))
     {
         IWebDriver webDriver = SeleniumDriver.GetDriver();
         Actions    actions   = new Actions(webDriver);
         actions.DoubleClick(webDriver.FindElement(locator)).Build().Perform();
     }
 }
Пример #2
0
        public static string GetValue(By locator, int waitInSecs)
        {
            string text = null;

            try
            {
                if (SeleniumVisibility.IsElementVisible(locator, waitInSecs))
                {
                    text = SeleniumDriver.GetDriver().FindElement(locator).Text;
                }
                else
                {
                    text = _textNotFound;
                    Console.WriteLine(text);
                }
            }
            catch (Exception e)
            {
                Console.WriteLine("Error getting value: " + e.StackTrace);
            }
            return(text);
        }