How to setup Selenium WebDriver with Visual Studio 2013?

Before setting up Selenium with Visual Studio, we should make sure that machine should have installed Visual Studio 2013 and NuGet.

So if above pre-requisites are in right place then start Visual Studio and create new project.


Select Visual C# > Test > Unit Test Project. Provide project name, location and click on OK button.


Select your project and right click. Click on Manage NuGet Packages…option.


Make sure you are pointing to ‘Online‘. Search the term ‘Selenium‘ and install Selenium WebDriver and Selenium WebDriver Support Classes. Now close the ‘Manage NuGet Package‘ window.


We will use Chrome browser to execute our first selenium script, so for this download Chrome driver from here.

Download and extract the file.

Open UnitTest1.cs file and include following namespaces-

using OpenQA.Selenium;
using OpenQA.Selenium.Chrome;

Now under TestMethod1() add following code-

IWebDriver driver = new ChromeDriver(@”D:\Download\VisualStudio_Projects”);


Now run the method. It will open the Chrome browser with and will search the term.

Comment out if above steps are not working for you.

Leave a Reply

Please log in using one of these methods to post your comment: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: