Issue
Obviously, I can set the wait time. Is there a way to find out what the implicit wait time is set to in selenium? (C# specifically)
(The idea is to disable the ImplicitWait, do something, then reset it to whatever the time was before.)
Solution
If you use the Page Objects pattern, keep the implicitlywait time in a field of the PageBase class, additionally, you would like to create some methods to reset or retrieve that value.
Sorry that the following example is in Java:
class PageBase {
private WebDriver driver;
private long implicitlyWaitTimeInSeconds;
public PageBase(WebDriver driver, long timeout) {
driver.manage().timeouts().implicitlyWait(timeout, TimeUnit.SECONDS);
implicitlyWaitTimeInSeconds = timeout;
this.driver = driver;
}
public void setImplicitlyWaitTime(long timeout) {
driver.manage().timeouts().implicitlyWait(timeout, TimeUnit.SECONDS);
implicitlyWaitTimeInSeconds = timeout;
}
public long getImplicitlyWaitTime() {
return implicitlyWaitTimeInSeconds;
}
...
}
class HomePage extends PageBase {
...
}
Answered By - user2432405
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.