As well as adding a reference to the project for Selenium WebDriver and NUnit, you must also add a “using” statement for the sections you are going to use in your test. A good start is to add the following using statements to your file:
[code]
using OpenQA.Selenium;
using OpenQA.Selenium.Firefox;
using NUnit.Framework;
[/code]

Note: If you have more than one CS file in your project, you will need a using statement(s) for each file as required.

This may seem as common sense to the more seasoned programmer but for those starting off at the beginning it is a useful reminder. In the example above I have added a using statement for the standard Selenium WebDriver and NUnit classes and also for the Firefox browser. There are many other possibilities, but I will cover those as we need them.

This screenshot shows where the using statements are usually placed in a C# file:
Using Statements

I use Microsoft Visual Studio 2013 to create my C# WebDriver tests. If you do not have this application then you can download Visual Studio Express from here. I think the most suitable option for our use is the “Express 2013 for Windows Desktop” version.

Select File > New > Project from the menu and you should see a dialog similar to this one:
Create New Project

Select Visual C# from the Installed Templates on the left and then select Class Library from the list in the center. Choose a name for your project and select a location to save it at the bottom of the dialog.

The next step is to add references to your project for Selenium WebDriver and NUnit. You could add these references by directly adding the dll’s but I will accomplish this by using the NuGet Packages which is much easier. The first step is to open the NuGet Packages dialog. In the Solution Explorer, right click on References and select “Manage NuGet Packages…”
Manage NuGet Packages

The next step is to add the references for Selenium WebDriver. To find the Selenium packages, search for “selenium” in the search box in the top right hand side of the dialog:
Add WebDriver References

Followed by a reference for NUnit (again, search for “nunit”):
Add Reference for NUnit

Once these references have been added, they should be displayed in the References section in the Solution Explorer like this:
Refernces have been added

At this stage we are now ready to start writting our C# code for our test.