Quick Start Guide

So you've downloaded the Selenium Toolkit and you need some help getting started? Awesome. This doc provides some basic info on how to setup and get started with some simple tests.

If you're a quick study or looking for a more technical details, you may want to check out the Selenium Toolkit Configuration Settings or Using Selenium Toolkit in a Continuous Integration Environment.

Setup your environment

Before you can run the Selenium Toolkit, you'll need the following prerequisites.

Download and install Selenium Toolkit

The Selenium Toolkit for .NET includes libraries and utilities to jump start your functional web testing. Download the latest release here.

Installation is simple, just follow the prompts.

After the installer runs, you should have everything you need to start writing tests.

Install Selenium IDE

Selenium IDE is a FireFox plugin that can record clicks and actions and convert them into Selenium scripts. For convenience, Selenium IDE is bundled with the Selenium Toolkit (but presently isn't part of the setup package). To install it:
  1. Navigate to Program Files\Selenium Toolkit\bin\selenium-ide
  2. Double click on the XPI file.
  3. When prompted for which program to open the file with, Browse to your FireFox installation folder

Writing Tests

Create a Test Project
  1. Open Visual Studio (or your IDE of choice)
  2. Create a new Class Library Project
  3. Add Project References:
    • nunit.framework
    • SeleniumToolkit.dll (Program Files\SeleniumToolkit\bin)
    • ThoughtWorks.Selenium.Core.dll (Program Files\SeleniumToolkit\bin)

Write a Simple Test

using SeleniumToolkit;
using Selenium;

namespace Example
{
    [WebFixture(BaseUrl="http://www.codeplex.com", Timeout=90000, DefaultBrowser="*iexplore")]
    public class Simple
    {
          [WebTest]
          public void CanOpenHomePage()
          {
                 ISelenium selenium = Browser.Current;

                 selenium.Open("/");
          }
    }
}


If you run the test using NUnit, you should see the Selenium test runner window and CodePlex website briefly. The test is very simplistic and should pass.

What's Next?

Now that you've installed all the components, you're ready to start writing some tests. Here's a few suggested next steps:

Last edited Jan 24, 2011 at 6:16 PM by bcook, version 7

Comments

ptoluganti Jun 10, 2011 at 9:16 PM 
Nothing is happening for me, NUnit opens any browser but its not opening the specified site.

bcook Jan 24, 2011 at 6:13 PM 
Thanks @pranjalnigam, missing a )

dowdian Jan 15, 2011 at 8:55 PM 
I believe it should be:

[WebFixture(BaseUrl="http://www.codeplex.com", Timeout=90000, DefaultBrowser="*iexplore")]

Honestly though, I can't say for certain. This line compiles, but when I run the project in NUnit nothing happens at all. Probably something I've done wrong, or possibly haven't done in NUnit.

pranjalnigam Dec 17, 2010 at 7:46 AM 
[WebFixture(BaseUrl="http://www.codeplex.com", Timeout=90000, Browser="*iexplore"], gives a 'missing bracket error message. Paramter 'Browser' is also in correct.