Selenium Manager is a .NET library designed to simplify parallel testing and dynamic browser instance management using Selenium WebDriver.
- Simplifies parallel testing with Selenium WebDriver
- Dynamic browser instance management
- Automatic browser selection based on statistics
- Customizable browser options
- Easily integrate with your existing Selenium projects
To use Selenium Manager, you need to install the NuGet package SeleniumManager.Core
.
To get started, you'll need to initialize the Selenium Manager by creating an instance of the SeleniumManager
class. You can provide a custom configuration file path or use the default configuration included in the library.
using SeleniumManager.Core;
// Initialize Selenium Manager with default configuration
var configManager = new ConfigManager();
var seleniumManager = new SeleniumGridManager(configManager);
Enqueuing an action allows you to add a function to the execution queue, which will be processed in parallel on available browser instances.
// Enqueue an action without specifying a browser
var result = await seleniumManager.EnqueueAction(BrowseWebsite);
// Enqueue an action and specify the browser
var chromeResult = await seleniumManager.EnqueueAction(BrowseWebsite, WebDriverType.Chrome.GetDescription());
Selenium Manager makes it easy to perform parallel testing by enqueuing multiple actions simultaneously.
using System.Threading.Tasks;
using System.Collections.Generic;
// Perform parallel testing with multiple tasks
List<Task> tasks = new List<Task>();
for (int i = 0; i < 10; i++)
{
Task task = Task.Run(async () =>
{
await seleniumManager.EnqueueAction(BrowseWebsite);
});
tasks.Add(task);
}
await Task.WhenAll(tasks);
The behavior of Selenium Manager can be customized using the ConfigurationSettings
class. This class encapsulates various configuration options related to Selenium Grid communication, browser options, concurrency, and more. For detailed information about the available properties and their usage, please refer to the ConfigurationSettings Reference.
For detailed information about the available classes, methods, and options, please refer to the API Reference.
Contributions to this project are welcome! For more information on how to contribute, please read the Contributing Guidelines.
This project is licensed under the MIT License.