WebComponentsHelper 2025.12.16.4

There is a newer version of this package available.
See the version list below for details.
dotnet add package WebComponentsHelper --version 2025.12.16.4
                    
NuGet\Install-Package WebComponentsHelper -Version 2025.12.16.4
                    
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="WebComponentsHelper" Version="2025.12.16.4" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="WebComponentsHelper" Version="2025.12.16.4" />
                    
Directory.Packages.props
<PackageReference Include="WebComponentsHelper" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add WebComponentsHelper --version 2025.12.16.4
                    
#r "nuget: WebComponentsHelper, 2025.12.16.4"
                    
#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.
#:package WebComponentsHelper@2025.12.16.4
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=WebComponentsHelper&version=2025.12.16.4
                    
Install as a Cake Addin
#tool nuget:?package=WebComponentsHelper&version=2025.12.16.4
                    
Install as a Cake Tool

WebComponentsHelper

A modular, reusable Page Object and UI Component library for web automation, built on top of Selenium WebDriver.
Targets .NET Standard 2.0 and .NET 8 for broad compatibility.

Features

  • Page Object Model (POM) Support:
    Organize your automation using page objects for maintainability and scalability.
  • Reusable UI Components:
    Includes ready-to-use components like TextBoxComponent, ButtonComponent, and extensible base classes for custom components.
  • BaseComponent Abstraction:
    All components inherit from BaseComponent, which provides robust Selenium wrapper methods for element interaction and waiting.
  • Strongly-Typed Page Objects:
    Example: LoginPage composes TextBoxComponent and ButtonComponent for clear, maintainable test code.
  • Extensible:
    Easily add new components (e.g., CheckboxComponent, DropdownComponent) following the same pattern.

Project Structure

/WebComponentsHelper /Components BaseComponent.cs ButtonComponent.cs TextBoxComponent.cs ... /PageObjects LoginPage.cs ...

Class Diagram

class SeleniumBase {
+WebDriver driver +WaitUntilElementExists() +WaitUntilElementVisible() +Click() +InputText() +GetStringValue() ... }

class BaseComponent {
    <<abstract>>
    +By _locator
    +Element
    +VisibleElement
    +IsDisplayed()
    +GetText()
    ...
}

class TextBoxComponent {
    +EnterText()
    +GetValue()
}

class ButtonComponent {
    +Click()
    +IsEnabled()
}

class LoginPage {
    +TextBoxComponent UsernameTextBox
    +TextBoxComponent PasswordTextBox
    +ButtonComponent LoginButton
    +Login()
}

SeleniumBase <|-- BaseComponent
BaseComponent <|-- TextBoxComponent
BaseComponent <|-- ButtonComponent
LoginPage o-- TextBoxComponent
LoginPage o-- ButtonComponent

Usage Example

using OpenQA.Selenium; using WebComponentsHelper.PageObjects;

class Example { public void LoginTest(IWebDriver driver) { var loginPage = new LoginPage(driver); loginPage.Login("user1", "password1"); } }

Example: Login Page Object

namespace WebComponentsHelper.PageObjects { public class LoginPage {
public TextBoxComponent UsernameTextBox { get; } public TextBoxComponent PasswordTextBox { get; } public ButtonComponent LoginButton { get; }

    public LoginPage(IWebDriver driver)
    {
        UsernameTextBox = new TextBoxComponent(driver, By.Id("username"));
        PasswordTextBox = new TextBoxComponent(driver, By.Id("password"));
        LoginButton = new ButtonComponent(driver, By.Id("loginBtn"));
    }

    public void Login(string username, string password)
    {
        UsernameTextBox.EnterText(username);
        PasswordTextBox.EnterText(password);
        LoginButton.Click();
    }
}   

}

Requirements

Extending

To add a new component, inherit from BaseComponent and implement your custom logic:

namespace WebComponentsHelper.Components { /// <summary> /// CheckboxComponent represents a checkbox UI component, providing methods to interact with and query its state. /// </summary>

public class CheckboxComponent : BaseComponent
{
    public CheckboxComponent(IWebDriver driver, By locator)
        : base(driver, locator)
    {
    }

    /// <summary>
    /// Checks the checkbox if it is not already checked.
    /// </summary>
    public void Check()
    {
        var checkbox = Element;
        if (!checkbox.Selected)
        {
            Click(checkbox);
        }
    }

    /// <summary>
    /// Unchecks the checkbox if it is checked.
    /// </summary>
    public void Uncheck()
    {
        var checkbox = Element;
        if (checkbox.Selected)
        {
            Click(checkbox);
        }
    }

    /// <summary>
    /// Toggles the checkbox state.
    /// </summary>
    public void Toggle()
    {
        var checkbox = Element;
        Click(checkbox);
    }

    /// <summary>
    /// Returns true if the checkbox is checked.
    /// </summary>
    public bool IsChecked()
    {
        return Element.Selected;
    }
}

}

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  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 is compatible.  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.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos 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
2025.12.19.1 190 12/19/2025
2025.12.18.1 263 12/18/2025
2025.12.17.1 260 12/17/2025
2025.12.16.5 258 12/16/2025
2025.12.16.4 259 12/16/2025
2025.12.16.3 252 12/16/2025
2025.12.16.2 260 12/16/2025