WebDriverWaitExtensions 3.2.0

dotnet add package WebDriverWaitExtensions --version 3.2.0                
NuGet\Install-Package WebDriverWaitExtensions -Version 3.2.0                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="WebDriverWaitExtensions" Version="3.2.0" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add WebDriverWaitExtensions --version 3.2.0                
#r "nuget: WebDriverWaitExtensions, 3.2.0"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// 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:

More Documentation

For more detailed documentation, please visit the wiki.

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 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
3.2.0 68,986 10/2/2024
3.1.0 21,582 9/23/2024
3.0.0 289 9/9/2024
2.0.2 8,044 9/28/2020
2.0.1 656 4/27/2020
2.0.0 491 3/2/2020
1.0.3 499 2/20/2020
1.0.2 464 2/19/2020
1.0.1 527 1/23/2020