/// <summary> /// Waits for a function to return true. VBScript: Function WaitEx(webdriver), VBA: Function WaitEx(webdriver As WebDriver) As Boolean /// </summary> /// <param name="procedure">Function reference. VBScript: wd.WaitFor GetRef(\"WaitEx\") VBA: wd.WaitFor AddressOf WaitEx)</param> /// <param name="argument">Optional - Argument to send to the function</param> /// <param name="timeout">Optional - timeout in milliseconds</param> /// <returns>Current WebDriver</returns> /// VBA example: /// <example><code lang="vbs"> /// Sub WaitForTitle(driver, argument, result) /// result = driver.Title = argument /// End Sub /// /// Sub testSimple() /// Dim driver As New FirefoxDriver /// driver.Get "http://www.google.com" /// driver.Until AddressOf WaitForTitle, "Google" /// ... /// End Sub /// </code> /// </example> /// /// VBScript example: /// <example><code lang="vbs"> /// Function WaitForTitle(driver, argument) /// WaitForTitle = driver.Title = argument /// End Function /// /// Sub testSimple() /// Dim driver As New FirefoxDriver /// driver.Get "http://www.google.com" /// driver.Until GetRef("WaitForTitle"), "Google", 1000 /// ... /// End Sub /// </code> /// </example> object ComInterfaces._WebDriver.Until(object procedure, object argument, int timeout) { if (timeout == -1) { timeout = session.timeouts.timeout_implicitwait; } return(COMExt.WaitUntilProc(procedure, this, argument, timeout)); }
/// <summary> /// Waits for a procedure to set the result argument to true. /// Procedure: /// </summary> /// <param name="procedure">Procedure</param> /// <param name="argument">Argument</param> /// <param name="timeout">Timeout in ms</param> /// <param name="timeoutMessage">Timeout message</param> /// <returns></returns> /// <example> /// VBA: /// <code lang="vbs"> /// Public Sub WaitForTitle(driver, arg) /// WaitForTitle = driver.Title = arg /// End Sub /// /// Public Sub Script() /// Dim Waiter As New Waiter /// Dim driver As New FirefoxDriver /// driver.Get "http://www.google.com/" /// Waiter.Until AddressOf WaitForTitle, driver, "Google" /// ... /// End Sub /// </code> /// /// VBScript: /// <code lang="vbs"> /// Public Sub WaitForTitle(driver, arg) /// WaitForTitle = driver.Title = arg /// End Sub /// /// Public Sub Script() /// Set Waiter = CreateObject("Selenium.Waiter") /// Set driver = CreateObject("Selenium.FirefoxDriver") /// driver.Get "http://www.google.com/" /// Waiter.Until GetRef("WaitForTitle"), 5000, driver, "Google" /// ... /// End Sub /// </code> /// </example> object ComInterfaces._Waiter.Until(object procedure, object argument, int timeout, string timeoutMessage) { if (timeout == -1) { timeout = _timeout; } return(COMExt.WaitUntilProc(procedure, argument, null, timeout)); }