This post has been migrated to http://www.thinkcode.se/blog/2012/10/29/selenium-webdriver-the-simplest-possible-start
Getting started with Selenium WebDriver may be an issue. You must write some code and get the code running. I have created what I think is the smallest possible solution that could work. It consists of two files, a project definition and the actual test.
Lets start with a project definition for Maven that will download the dependencies needed and execute a test. The simplest possible Maven pom that will work is this:
The two most important things here are the two dependencies. The first one will include JUnit so a test can be written. The second one will include WebDriver so a browser can be started and a web page can be interacted with.
A test that will connect to a web site and execute something may look like this:
To execute this test, you need to execute Maven:
All dependencies you need will be downloaded. A Firefox should be launched and Bing should be searched for WebDriver.
The files has to live in this structure:
example |-- pom.xml `-- src `-- test `-- java `-- AskTest.java