Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion dotnet/src/support/UI/PopupWindowFinder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ public string Invoke(Action popupMethod)

ReadOnlyCollection<string> existingHandles = this.driver.WindowHandles;
popupMethod();
WebDriverWait wait = new WebDriverWait(SystemClock.Instance, this.driver, this.timeout, this.sleepInterval);
var wait = new WebDriverWait(this.driver, this.timeout, this.sleepInterval);
string popupHandle = wait.Until(driver =>
{
ReadOnlyCollection<string> newHandles = driver.WindowHandles;
Expand Down
12 changes: 12 additions & 0 deletions dotnet/src/webdriver/Support/WebDriverWait.cs
Original file line number Diff line number Diff line change
Expand Up @@ -58,5 +58,17 @@ public WebDriverWait(IClock clock, IWebDriver driver, TimeSpan timeout, TimeSpan
this.IgnoreExceptionTypes(typeof(NotFoundException));
}

/// <summary>
/// Initializes a new instance of the <see cref="WebDriverWait"/> class.
/// </summary>
/// <param name="driver">The WebDriver instance used to wait.</param>
/// <param name="timeout">The timeout value indicating how long to wait for the condition.</param>
/// <param name="sleepInterval">A <see cref="TimeSpan"/> value indicating how often to check for the condition to be true.</param>
/// <exception cref="ArgumentNullException">If <paramref name="driver"/> is <see langword="null"/>.</exception>
public WebDriverWait(IWebDriver driver, TimeSpan timeout, TimeSpan sleepInterval)
: this(SystemClock.Instance, driver, timeout, DefaultSleepTimeout)
{
}

private static TimeSpan DefaultSleepTimeout => TimeSpan.FromMilliseconds(500);
}