Next-Gen App & Browser Testing Cloud
Trusted by 2 Mn+ QAs & Devs to accelerate their release cycles

This MSTest testing tutorial covers different ways of installing Selenium WebDriver for the MSTest framework in C#.

Himanshu Sheth
December 28, 2025
In the on-going ‘Selenium MSTest testing tutorial’ series, we earlier had a look at setting up the MSTest framework in Visual Studio. It was a getting started guide with a major focus on the installation of the Selenium MSTest framework and MSTest adapter for the project. In case you are starting up with the MSTest framework, we recommend that you check out the installation guide on MSTest Tutorial: Environment Setup For Selenium Testing.
In this Selenium MSTest testing tutorial, we take a look at setting up Selenium WebDriver with Visual Studio in C#. Before we install the Selenium WebDriver, we create a new project in C#.
Starting your journey with Selenium WebDriver? Check out this step-by-step guide to perform Automation testing using Selenium WebDriver Tutorial. If you’re looking to improve your Selenium interview skills, check out our curated list of Selenium interview questions and answers.
Using Selenium WebDriver with MSTest in C# helps you automate web testing inside a .NET environment. MSTest provides structure, reporting, and test management, while Selenium handles browser interactions.
How to Create C# Project for Selenium Automation?
Before setting up Selenium WebDriver, you first need to create a C# project using Visual Studio. This setup ensures a structured environment for writing and executing automated browser tests with MSTest.
How to Download Selenium WebDriver in Visual Studio?
Before executing your first Selenium script in MSTest, you need to set up Selenium WebDriver. It can be installed easily through NuGet, the official package manager for Microsoft platforms.
Before installing Selenium WebDriver, we create a new project in C# by following the below-mentioned steps:


Before running your first script in MSTest, you need to download and set up Selenium WebDriver.
Selenium WebDriver on Visual Studio can be installed using NuGet, a free and open-source package manager that is specifically designed for the Microsoft Platform. There are two options for installing Selenium WebDriver – using the Visual Studio IDE and using the NuGet Package Manager (PM) Commands.
For installing Selenium WebDriver using the VS IDE, please perform the following steps:



using Microsoft.VisualStudio.TestTools.UnitTesting;
using OpenQA.Selenium;
using OpenQA.Selenium.Chrome;
namespace MSTest_Test_Project
{
[TestClass]
public class UnitTest1
{
[TestMethod]
public void TestMethod1()
{
}
}
}
If you are more comfortable with the command-line terminal, Selenium WebDriver can also be installed by executing the relevant commands on the Package Manager (PM) console.

Install-Package Selenium.WebDriver
Install-Package Selenium.Chrome.WebDriver
Read: Most Complete MSTest Framework Tutorial Using .Net Core.
Shown below is the snapshot of the Package Manager Console:


To verify whether the necessary packages are installed, execute the Get-Package command on the PM console.
PM> Get-Package
Id Versions
-- --------
Selenium.WebDriver {3.141.0}
Selenium.Chrome.WebDriver {79.0.0}
...... ......
...... ......
This MSTest Tutorial for beginners and professionals will help you learn how to use MSTest framework with Selenium C# for performing Selenium automation testing.

With this Selenium MSTest setup example, we had a look at setting up Selenium WebDriver for automated testing with MSTest and C#. The steps mentioned in this Selenium C# tutorial are essential to get started with automation testing with Selenium and C#. With the completion of the Selenium MSTest framework & Selenium installation, you are all set to perform cross browser testing or automated browser testing with MSTest, Selenium, and C# ☺.
CEO, Vercel
Discovered @TestMu AI yesterday. Best browser testing tool I've found for my use case. Great pricing model for the limited testing I do 👏
Deliver immersive digital experiences with Next-Generation Mobile Apps and Cross Browser Testing Cloud
Did you find this page helpful?
More Related Hubs
TestMu AI forEnterprise
Get access to solutions built on Enterprise
grade security, privacy, & compliance