コード例 #1
0
ファイル: SeleniumExtender.cs プロジェクト: marsak1/apka
        public static bool ClickWithWaitEx(IWebElement e, bool checkByDisplayed = true, int secondsWait = SeleniumExecutor.Timeout)
        {
            if (checkByDisplayed)
            {
                SeleniumWait.WaitForElementToBeDisplayedEx(e, secondsWait);
            }
            else
            {
                SeleniumWait.WaitForElementToBeEnabledEx(e, secondsWait);
            }

            SeleniumExecutor.ChangeWaitTimeout(0);
            for (int i = 0; i < 2 * secondsWait; ++i)
            {
                if (SeleniumExecutor.ignoreCurrentTest)
                {
                    Assert.Ignore(SeleniumExecutor.ignoreByNoConnection);
                }

                try
                {
                    e.Click();
                    SeleniumExecutor.SetDefaultWaitTimeout();
                    return(true);
                }
                catch (Exception)
                {
                    System.Threading.Thread.Sleep(500);
                }
            }

            SeleniumExecutor.SetDefaultWaitTimeout();
            return(false);
        }
コード例 #2
0
ファイル: SeleniumExtender.cs プロジェクト: marsak1/apka
 public static IWebElement FindElementWithWait(IWebElement element, int secondsWait = SeleniumExecutor.Timeout)
 {
     if (SeleniumWait.WaitForElementToBeDisplayedEx(element, secondsWait))
     {
         return(element);
     }
     else
     {
         return(null);
     }
 }
コード例 #3
0
ファイル: SeleniumExtender.cs プロジェクト: marsak1/apka
 public static string GetTextFromElementEx(IWebElement element)
 {
     SeleniumWait.WaitForElementToBeDisplayedEx(element);
     return(element.Text);
 }
コード例 #4
0
ファイル: SeleniumExtender.cs プロジェクト: marsak1/apka
 public static void ClearWithWait(this IWebElement e)
 {
     SeleniumWait.WaitForElementToBeDisplayedEx(e);
     SeleniumWait.WaitForElementToBeEnabledEx(e);
     e.Clear();
 }
コード例 #5
0
ファイル: SeleniumExtender.cs プロジェクト: marsak1/apka
 public static void SendKeysWithWait(this IWebElement e, String text)
 {
     SeleniumWait.WaitForElementToBeDisplayedEx(e);
     e.SendKeys(text);
 }
コード例 #6
0
ファイル: SeleniumExtender.cs プロジェクト: marsak1/apka
 public static SelectElement GetSelectElement(IWebElement element)
 {
     SeleniumWait.WaitForElementToBeEnabledEx(element);
     return(new SelectElement(element));
 }