コード例 #1
0
 /// <summary>
 /// Wait until the text on the element contains one of the element in the collection of text passed for match
 /// </summary>
 /// <param name="textsToMatch">text collection that will be used for the match</param>
 /// <param name="waitTimeSec">total amount of time to wait (in seconds) to meet the condition</param>
 /// <param name="throwExceptionWhenNotFound">throw an exception when the condition is not met</param>
 /// <param name="errorMessage">message for the exception when condition is not met</param>
 /// <returns>true when the condition is met or else returns false</returns>
 public bool WaitUntilElementTextContains(string[] textsToMatch, int waitTimeSec, bool throwExceptionWhenNotFound = true, string errorMessage = null)
 => WebElementExtensions.WaitUntilElementTextContains(RawElement,
                                                      Driver,
                                                      textsToMatch: textsToMatch,
                                                      waitTimeSec: waitTimeSec,
                                                      errorMessage: errorMessage,
                                                      baseControl: this);
コード例 #2
0
 /// <summary>
 /// Wait until the element exists
 /// </summary>
 /// <param name="waitTimeSec">total amount of time to wait (in seconds) to meet the condition</param>
 /// <param name="throwExceptionWhenNotFound">throw an exception when the condition is not met</param>
 /// <param name="errorMessage">message for the exception when condition is not met</param>
 /// <returns>true when the condition is met or else returns false</returns>
 public bool WaitUntilElementExists(int waitTimeSec, bool throwExceptionWhenNotFound = true, string errorMessage = null)
 => WebElementExtensions.WaitUntilElementExists(RawElement,
                                                Driver,
                                                waitTimeSec: waitTimeSec,
                                                throwExceptionWhenNotFound: throwExceptionWhenNotFound,
                                                errorMessage: errorMessage,
                                                baseControl: this);
コード例 #3
0
 /// <summary>
 /// Wait until the text on the element after trim is starts with the text passed for match
 /// </summary>
 /// <param name="textToMatch">text that will be used for the match</param>
 /// <param name="waitTimeSec">total amount of time to wait (in seconds) to meet the condition</param>
 /// <param name="throwExceptionWhenNotFound">throw an exception when the condition is not met</param>
 /// <param name="errorMessage">message for the exception when condition is not met</param>
 /// <returns>true when the condition is met or else returns false</returns>
 public bool WaitUntilElementTextStartsWith(string textToMatch, int waitTimeSec, bool throwExceptionWhenNotFound = true, string errorMessage = null)
 => WebElementExtensions.WaitUntilElementTextStartsWith(RawElementFind,
                                                        Driver,
                                                        textToMatch: textToMatch,
                                                        waitTimeSec: waitTimeSec,
                                                        throwExceptionWhenNotFound: throwExceptionWhenNotFound,
                                                        errorMessage: errorMessage,
                                                        baseControl: this);
コード例 #4
0
 public static void WaitTillPageLoad(this IWebDriver driver, int timeToWaitInSeconds = 0)
 {
     WebElementExtensions.WaitGeneric(
         element: null,
         driver: driver,
         waitTimeSec: timeToWaitInSeconds,
         throwExceptionWhenNotFound: true,
         errorMessage: "failed while waiting for document ready state",
         process: () => driver.ExecuteJavaScript("return document.readyState").Equals("complete"),
         reasonForFailedCondition: "");
 }