Selenium C# Articles

RSS feed

32 articles found in Selenium C#

Best C# Testing Frameworks In 2026
Best C# Testing Frameworks In 2026

Discover these C# testing frameworks for 2026 and streamline your test automation in building high-quality web and mobile applications.

Suryapratap Singh Chauhan

Suryapratap Singh Chauhan

February 10, 2025

37 min read

Top Selenium C# Frameworks for Automation Testing in 2026
Top Selenium C# Frameworks for Automation Testing in 2026

Explore the top Selenium C# frameworks for automation testing in 2026, including NUnit, xUnit, and MSTest, to enhance your testing efficiency.

Himanshu Sheth

Himanshu Sheth

February 7, 2025

33 min read

Top 28 Selenium WebDriver Commands in NUnit For Automation
Top 28 Selenium WebDriver Commands in NUnit For Automation

Selenium WebDriver commands are the methods used to run your Selenium test automation scripts. Here are the commands you need to automate browser actions.

Himanshu Sheth

Himanshu Sheth

January 30, 2025

32 min read

How to Scroll Down in Selenium C#
How to Scroll Down in Selenium C#

Selenium C# scrolls a page by casting the WebDriver to IJavaScriptExecutor and running JavaScript through ExecuteScript, since Selenium's built-in methods do not handle scrolling reliably on their own. Common examples scroll by a fixed 250 pixels, jump to the page bottom, or bring a specific element into view with scrollIntoView, using Selenium.WebDriver 4.49.0 via NuGet.

Andreea Draniceanu

September 10, 2024

21 min read

How To Generate NUnit Reports
How To Generate NUnit Reports

In this tutorial, you will learn about generating NUnit reports along with some new features and advantages of ExtentReports.

Himanshu Sheth

Himanshu Sheth

June 24, 2024

27 min read

A Beginner's Guide To SpecFlow ScenarioContext
A Beginner's Guide To SpecFlow ScenarioContext

The ScenarioContext class is a shared context object used in SpecFlow to share data between different steps and scenarios. This tutorial demonstrates using SpecFlow and ScenarioContext to share data between steps.

Andreea Draniceanu

January 9, 2024

30 min read

How to Find Element by Text in Selenium C#
How to Find Element by Text in Selenium C#

Finding an element by text in Selenium C# means using the XPath locator strategy to select a web element based on its visible text rather than an ID or class name. FindElement returns the first matching element, FindElements returns every match as a list, and normalize-space ignores leading or trailing spaces in the text.

Andreea Draniceanu

October 26, 2023

29 min read

How to Run Multiple NUnit Test Cases
How to Run Multiple NUnit Test Cases

NUnit provides methods to run multiple test cases, saving time and while ensuring high code quality. In this tutorial, learn how to run multiple NUnit test cases in parallel.

Andreea Draniceanu

October 9, 2023

26 min read

IWebDriver Browser Commands In Selenium C#: A Detailed Guide
IWebDriver Browser Commands In Selenium C#: A Detailed Guide

In this Selenium C# tutorial, you will learn about the IWebDriver browser commands in C# and how to use them effectively in your testing efforts.

Andreea Draniceanu

April 25, 2023

25 min read

How To Use WebDriverWait In Selenium C#
How To Use WebDriverWait In Selenium C#

WebDriverWait in Selenium C# is an explicit wait from the OpenQA.Selenium.Support.UI package that pauses a test until a condition like ElementToBeClickable is met, checking every 250 milliseconds by default. An MSTest example downloads a file, waits for a Close button to become clickable, and runs on a cloud Selenium Grid using Chrome 101 on Windows 11.

Andreea Draniceanu

February 10, 2023

24 min read

How To Refresh Page Using Selenium C# [Complete Tutorial]
How To Refresh Page Using Selenium C# [Complete Tutorial]

Selenium C# refreshes a page three ways: the Navigate().Refresh() command, Navigate().GoToUrl() pointed at the current URL, or simulating an F5 keypress. Refreshing re-attaches elements to the DOM, which avoids StaleElementReferenceException, the error thrown when a previously located element has been detached or removed, distinct from NoSuchElementException, where the element was never found at all.

Andreea Draniceanu

January 6, 2023

16 min read

How To Use driver.FindElement And driver.FindElements In Selenium C#
How To Use driver.FindElement And driver.FindElements In Selenium C#

Learn how to use driver.FindElement and driver.FindElements in Selenium C# to locate one or many web elements with ID, CSS, XPath and relative locators.

Andreea Draniceanu

December 20, 2022

28 min read

How To Select Dropdown In Selenium C#
How To Select Dropdown In Selenium C#

In Selenium C#, the SelectElement class from the Selenium.Support package selects and deselects options in HTML dropdowns defined by the select tag, letting a script choose values without clicking each option. The class's IsMultiple property returns true when a dropdown allows multiple selections, and its SelectByIndex method numbers options starting from zero rather than one.

Andreea Draniceanu

July 8, 2022

22 min read

Guide To Scraping Dynamic Web Pages Using Selenium And C#
Guide To Scraping Dynamic Web Pages Using Selenium And C#

Learn how to scrape dynamic web pages in this guide. Discover several scraping dynamic page strategies and tools to easily and efficiently collect data.

Himanshu Sheth

Himanshu Sheth

March 29, 2021

28 min read

NUnit vs xUnit vs MSTest: Which C# Framework Wins?
NUnit vs xUnit vs MSTest: Which C# Framework Wins?

The three C# unit testing frameworks head-to-head: syntax, parallelism, speed, and ecosystem, with a clear recommendation for your next project.

Himanshu Sheth

Himanshu Sheth

March 22, 2021

39 min read

Best XUnit Parameterized Tests Tutorial: Selenium Testing
Best XUnit Parameterized Tests Tutorial: Selenium Testing

XUnit Parameterized tests allow testers to run the same test a few times using different values. Find out how you can do this in xUnit with InlineData, MemberData, and ClassData.

Himanshu Sheth

Himanshu Sheth

March 18, 2021

16 min read

Most Complete MSTest Framework Tutorial Using .Net Core
Most Complete MSTest Framework Tutorial Using .Net Core

Learn about the MSTest Framework using .Net Core in Selenium C# and the aspects related to cross browser testing and parallel testing in this MSTest tutorial.

Himanshu Sheth

Himanshu Sheth

March 6, 2021

30 min read

How To Use NUnit Annotations For Selenium Automation Testing?
How To Use NUnit Annotations For Selenium Automation Testing?

Learn how to use annotations in NUnit for Selenium-based automation testing. We will look at an example for each annotation along with their attributes.

Himanshu Sheth

Himanshu Sheth

March 1, 2021

39 min read

How To Use Asserts In NUnit Using Selenium?
How To Use Asserts In NUnit Using Selenium?

In this NUnit tutorial, you will learn how to use different asserts in NUnit and see how they are helpful in Selenium automation testing.

Himanshu Sheth

Himanshu Sheth

February 8, 2021

33 min read

NUnit Setup in Visual Studio: A Quick Tutorial
NUnit Setup in Visual Studio: A Quick Tutorial

Want to setup NUnit environment for your first test? In this NUnit tutorial, you will learn to setup a test runner and Selenium WebDriver with Visual Studio for NUnit test case development.

Himanshu Sheth

Himanshu Sheth

February 3, 2021

15 min read

NUnit Tutorial: Parameterized Tests With Examples
NUnit Tutorial: Parameterized Tests With Examples

Learn NUnit parameterized tests with examples for efficient cross-browser testing by testing code against different input values for a better web experience.

Himanshu Sheth

Himanshu Sheth

December 2, 2020

24 min read

XUnit Testing Tutorial: Running First Script in XUnit
XUnit Testing Tutorial: Running First Script in XUnit

Moving on with our xUnit testing tutorial series, this blog will guide you in using xUnit testing framework with Selenium C#.

Himanshu Sheth

Himanshu Sheth

October 16, 2020

12 min read

SpecFlow Tutorial For Automation Testing With Selenium C#
SpecFlow Tutorial For Automation Testing With Selenium C#

Using SpecFlow with Selenium C# is a crucial part of automation testing with Selenium, this SpecFlow tutorial will guide you through the entire process.

Himanshu Sheth

Himanshu Sheth

August 28, 2020

40 min read

xUnit Testing Tutorial: Unit Testing With Selenium C#
xUnit Testing Tutorial: Unit Testing With Selenium C#

xUnit is an open-source unit testing framework for .NET. This xUnit testing tutorial will help you learn how to run unit testing with Selenium C#.

Himanshu Sheth

Himanshu Sheth

July 22, 2020

46 min read

Selenium C# Tutorial For Test Automation
Selenium C# Tutorial For Test Automation

Learn Selenium C# testing: environment setup, popular frameworks like NUnit and SpecFlow, and Visual Studio tutorials with real code examples.

Himanshu Sheth

Himanshu Sheth

May 19, 2020

8 min read

Selenium C#: Page Object Model Guide & Examples
Selenium C#: Page Object Model Guide & Examples

The Page Object Model is a design pattern that represents each web page as a separate class containing its elements and the methods to interact with them, keeping test code from touching the UI directly. This Selenium C# tutorial shows how POM cuts code duplication, limits the fallout from locator changes, and improves reusability and maintainability.

Himanshu Sheth

Himanshu Sheth

April 24, 2020

31 min read

Selenium C# Tutorial: Handling Frames and iFrames With Examples
Selenium C# Tutorial: Handling Frames and iFrames With Examples

Selenium C# handles frames and iframes through the SwitchTo() command, using a unique window handle to target them by frame id, frame name, or a web element locator such as XPath or CssSelector. SwitchTo().DefaultContent() returns to the page's main document, and SwitchTo().ParentFrame() moves back up to the parent of the currently selected frame, which also covers nested frames.

Himanshu Sheth

Himanshu Sheth

April 16, 2020

18 min read

Selenium C# Tutorial: Handling Multiple Browser Windows
Selenium C# Tutorial: Handling Multiple Browser Windows

Selenium C# assigns each browser window a unique alphanumeric window handle when the WebDriver instance opens it, and the SwitchTo() command uses that handle to move focus between windows, tabs, or pop-ups. The WindowHandle property returns the current window's handle as a string, while WindowHandles returns a read-only collection of every open handle.

Himanshu Sheth

Himanshu Sheth

April 10, 2020

18 min read

Selenium C#: Guide to Managing Alert Windows Effectively
Selenium C#: Guide to Managing Alert Windows Effectively

Alert windows in Selenium C# are blocking pop-ups that require a user action, such as accept, dismiss, or SendKeys, before the underlying page continues, and switching to one requires calling SwitchTo() first. NUnit-based Selenium C# examples cover each alert type, including authentication alerts, using accept, dismiss, and SendKeys operations.

Himanshu Sheth

Himanshu Sheth

April 3, 2020

15 min read

Selenium C# Tutorial on Explicit and Fluent Wait
Selenium C# Tutorial on Explicit and Fluent Wait

Explicit wait in Selenium uses the WebDriverWait class to pause a script only until a specific condition, such as an element becoming visible or clickable, is met, with a default polling interval of 500 milliseconds. This Selenium C# tutorial shows how to implement explicit and fluent wait in test automation scripts for more stable execution.

Himanshu Sheth

Himanshu Sheth

March 27, 2020

20 min read

Selenium C# Tutorial: Using Implicit Wait In Selenium C#
Selenium C# Tutorial: Using Implicit Wait In Selenium C#

Implicit wait in Selenium C# is a WebDriver setting that polls the DOM every 500ms until an element loads, set via driver.Manage().Timeouts().ImplicitWait.

Himanshu Sheth

Himanshu Sheth

March 20, 2020

12 min read

Selenium C# Tutorial: Setting Up Selenium In Visual Studio
Selenium C# Tutorial: Setting Up Selenium In Visual Studio

Selenium C# test automation in Visual Studio starts with installing Visual Studio Community Edition, downloading the Selenium WebDriver client driver, and creating an NUnit test project. The example test navigates to google.com, enters a search term via a CSS selector, and clicks Google Search, with ChromeDriver launched in NUnit's SetUp method and closed in TearDown.

Himanshu Sheth

Himanshu Sheth

March 13, 2020

12 min read