Exemple #1
0
 public void DialogIsVisibleInBrowser(string title)
 {
     Assert.True(
         _browser
         .FindElementByXPath(XPathBuilder.Dialog(title))
         .IsMatched());
 }
Exemple #2
0
        public static XPathBuilder Custom(string fullPath)
        {
            var res = new XPathBuilder(fullPath, false)
            {
                IsClosed = true
            };

            return(res);
        }
        public static IWebElement FindElementByXPath(
            this RemoteWebDriver self, XPathBuilder xpath, TimeSpan?maxWait = null)
        {
            //inspired by https://stackoverflow.com/questions/20798752/how-can-i-ask-the-selenium-webdriver-to-wait-for-few-seconds-after-sendkey
            var to     = maxWait ?? GetDefaultDomTimeout(self) ?? DefaultDomTimeout;
            var waiter = new WebDriverWait(self, to);

            return(waiter.Until(x => {
                try {
                    return ((RemoteWebDriver)x).FindElementByXPath(xpath.AsString());
                } catch (Exception) {
                    return null;
                }
            }));
        }
Exemple #4
0
 public void MatchesXPathInBrowser(XPathBuilder xpath)
 {
     Assert.True(_browser.FindElementByXPath(xpath).IsMatched());
 }
Exemple #5
0
 public void InputHasValue(XPathBuilder xpath, string expectedValue)
 {
     Assert.Equal(
         expectedValue,
         _browser.FindElementByXPath(xpath).GetAttribute("value"));
 }