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:
- Navigate to Program Files\Selenium Toolkit\bin\selenium-ide
- Double click on the XPI file.
- When prompted for which program to open the file with, Browse to your FireFox installation folder
Writing Tests
Create a Test Project
- Open Visual Studio (or your IDE of choice)
- Create a new Class Library Project
- 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: