WebDriverWaitExtensions 3.2.0
dotnet add package WebDriverWaitExtensions --version 3.2.0
NuGet\Install-Package WebDriverWaitExtensions -Version 3.2.0
<PackageReference Include="WebDriverWaitExtensions" Version="3.2.0" />
paket add WebDriverWaitExtensions --version 3.2.0
#r "nuget: WebDriverWaitExtensions, 3.2.0"
// Install WebDriverWaitExtensions as a Cake Addin #addin nuget:?package=WebDriverWaitExtensions&version=3.2.0 // Install WebDriverWaitExtensions as a Cake Tool #tool nuget:?package=WebDriverWaitExtensions&version=3.2.0
WebDriverWait Extensions
About
WebDriverWait Extensions is a C# library that provides extension methods for the WebDriverWait class in Selenium WebDriver. It is designed to simplify the process of waiting for certain conditions to be met in a web page when automating browser interactions.
There has been a lot of focus on the returned error messages when the condition isn't met which will even include the name of the parameter. This is especially helpful when using the page object model.
var signUpButton = By.Id("sign-up");
var wait = new WebDriverWait(driver, TimeSpan.FromSeconds(10));
wait.UntilElement().IsVisible(signUpButton);
In the above example the element was found but was not visible which returned the follow error:
Locator Name: 'signUpButton'
Locator: 'By.Id: sign-up'
Displayed: False
Enabled: True
Location: {X=90,Y=110}
Selected: False
Size: {Width=211, Height=66}
TagName: a
Text: ''
You can use the 'out' keyword to return a Condition
object which will contain the condition result and will contain the
error if one occured. This allows you to use these wait conditions as asserts.
If we had a method to check if an element is visible for use in an assert, and we wanted to ensure it waits long enough to become visible, it would either always return true or throw an exception. By using the Condition object, we can suppress the exception and allow the condition to run and return the result.
wait.UntilElement().IsVisible(signUpButton, out var condition);
Assert.That(condition.Result, Is.True, condition.Error);
Features
The library provides the following features:
- Alert Conditions: Methods for handling alert conditions.
- Element Conditions: Methods for handling element conditions.
- Frame Conditions: Methods for handling frame conditions.
- Network Conditions: Methods for handling network conditions.
- Text in Element Conditions: Methods for handling text in element conditions.
- Title Conditions: Methods for handling title conditions.
- URL Conditions: Methods for handling URL conditions.
More Documentation
For more detailed documentation, please visit the wiki.
Donate
If you find this project useful and would like to support its development, please consider making a donation.
Your contributions help to improve and maintain the project.
Donate via PayPal
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net6.0 is compatible. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
-
net6.0
- Selenium.WebDriver (>= 4.25.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.