This article explains the steps to be followed to setup the
Selenium WebDriver with C#.
Prior to Selenium 2.2.0, all Selenium C# bindings were
distributed as unsigned dlls. But, currently, the C# Bindings are distributed
as the signed DLLs along with their dependency DLLs.
The following steps to be followed to setup the Selenium
WebDriver with C#.
- The C# bindings(named as “selenium-dotnet-strongnamed-2.35.0.zip”) can be downloaded from https://code.google.com/p/selenium/downloads/list .
- Launch Microsoft Visual Studio and navigate to File> New> Project and observe that the following window is opened.
- Select Class Library from the list and enter the Soultion name as “WebDriverWithCS” as shown in the above picture.
- Right click on the Solution name “WebDriverWithCS” in “SolutionExplorer” and click on “Add Reference” option and observe that a Window is opened to select the DLLs as shown below.
- Click on the Browse button and traverse to the path where the unzipped files[Step#01] are placed, and select all the files and the click on “OK” button.
- Observe that the Dotnet DLLS are added and displayed under “Solution Explorer”> Solution name()> References” section as shown below.
- Just type the following lines of code just above the namespace.
using OpenQA.Selenium;
using OpenQA.Selenium.Firefox;
using OpenQA.Selenium.Support.UI;
Now we are set to write our Selenium C# script on Firefox.
Please feel free to add more comments to this article.
I have learned something about Selenium 2.2.0 which I'll mention in my upcoming blog. I appreciate your article very much. It is very nicely written and audited. Thanks!
ReplyDeleteRegards,
Prasant
@ Prasant, Thanks a lot for your valuable feedback!!
ReplyDelete