SeleniumSharper 1.2.0

dotnet add package SeleniumSharper --version 1.2.0
NuGet\Install-Package SeleniumSharper -Version 1.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="SeleniumSharper" Version="1.2.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add SeleniumSharper --version 1.2.0
#r "nuget: SeleniumSharper, 1.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 SeleniumSharper as a Cake Addin
#addin nuget:?package=SeleniumSharper&version=1.2.0

// Install SeleniumSharper as a Cake Tool
#tool nuget:?package=SeleniumSharper&version=1.2.0

SeleniumSharper

Build & Test NuGet Downloads

SeleniumSharper is a powerful, lightweight tool that makes working with Selenium much easier. By offering a set of useful extensions and tools, it enhances the experience of working with Selenium.

Table of contents

Installation

You should install SeleniumSharper with NuGet:

Install-Package SeleniumSharper

Or via the .NET Core command line interface:

dotnet add package SeleniumSharper

Either commands, from Package Manager Console or .NET Core CLI, will download and install SeleniumSharper and all required dependencies.

Usage

Wait conditions

var title = driver.Wait(30)
    .Until(ctx => ctx.Title)
    .Satisfies(title => title.Equals("My awesome title"));

WebDriverManager

Here is an example of how to use WebDriverManager to setup a specific type of driver with a custom configuration:

var webDriverPath = WebDriverManager
    .For<ChromeDriver>()
    .With(config =>
    {
        config.VersionResolveStrategy = VersionResolveStrategy.SpecificVersion;
        config.Version = "113.0.5672.24";
    })
    .Setup();

You can also use the default configuration if you don't need to set any custom options:

var webDriverPath = WebDriverManager
    .For<ChromeDriver>()
    .Setup();

Credits

I would like to give credit to the following resources that have inspired this project.

WebDriverManager.Net

The idea for automatically downloading and installing driver binaries was inspired by the repository WebDriverManager.Net. However, this project uses a slightly different approach by creating a driver manager that returns the instance of the IWebDriver, making it even easier to work with it.

DotNetSeleniumExtras

The idea for implementing an enhanced methodology to wait for conditions to be satisfied in Selenium was inspired by the repository DotNetSeleniumExtras. Fascinated by the concept, I developed my own implementation. The waiting methods included in this library are designed to resemble a sentence and are capable of accepting Func<> delegates, thereby increasing their flexibility and variety.

Product Compatible and additional computed target framework versions.
.NET net7.0 is compatible.  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
1.2.0 175 4/25/2023
1.1.0 156 4/21/2023
1.0.0 133 4/19/2023
1.0.0-preview.0 78 4/18/2023