Canarys | IT Services

Blogs

How to Set Up Selenium WebDriver in Visual Studio Enterprise 2015?

,
Share

Pre-requisite : Visual Studio Enterprise 2015 application should be installed into the system.

Create the new project in Visual Studio : Select New option from File menu and click on Project. Refer Fig.1.

1

Fig.1

On New Project windows popup > Select Visual C# > Windows > Console Application > Enter Name and Location and click on OK button. Refer Fig.2.

2

Fig.2

Created Project will display in the Solution Explorer. Refer Fig.3.

3

Fig.3

Install Selenium WebDriver : Right click on Reference > Select Manage NuGet Packages option. Refer Fig.4.

4

Fig.4

NuGet Package windows popup > select the Browse option > Enter search value into the search field as ‘Selenium’. Refer Fig.5.

5

Fig.5

Click on Selenium.WebDriver and Selenium.Support options and select the versions as per project requirement. Click on Install button and complete the installation process. Refer Fig.6 and Fig.7 respectively.

6

Fig.6

7

Fig.7

Once installation process ends, installed WebDriver will display under Reference. Refer Fig.8.

8

Fig.8

Install NUnit Framework : Enter NUnit in Search field of Manage NuGet Package screen.  Select the NUnit Framework, click on Install button and complete installation process. Refer Fig.9.

9

Fig.9

Once NUnit Framework installed into the system it will display under Reference. Refer Fig.10.

10

Fig.10

Install ChromeDriver, FireforDriver and IEDriver : Enter search value into the search field on NuGet screen. i.e. Selenium. Browser references will display on NuGet screen. Select the required browser reference and click on install. Refer Fig.11 and Fig.12.

11

Fig.11

12

Fig.12

Writing Selenium C# script in Visual Studio : Below script is to launch the browser, open Google page and search for ‘Canarys Automations Pvt Ltd’. Refer Fig.13.

13

Fig.13

Run Selenium C# script : Build the Test, click on Start to Run it. It will launch the browser, open Google page and search for desired value. Refer Fig. 14 and Fig.15 respectively.

14

Fig.14

15

Fig.15

Wishing you the Best in Your Efforts…!!

Leave a Reply

Your email address will not be published. Required fields are marked *

Reach Us

With Canarys,
Let’s Plan. Grow. Strive. Succeed.