11 September 2011

I recently released Selenium JUnit 4 Runner. It is an extension for JUnit 4 providing a test runner to execute Selenium test cases. Both the Selenium 1.0 (Server) and 2.0 (Web Driver) APIs are supported.

Here is a very simple example:

    public GoogleHomePageTest {

    private WebDriver webDriver;

    public void testGoogleSearch() {
        assertEquals("Google", webDriver.getTitle());

The Selenium JUnit 4 Class Runner launches the Selenium web driver or connects to the Selenium server before executing any methods annotated with @BeforeClass. It then autowires any members of the test class or method rules that have been annotated with @SeleniumBrowser or @SeleniumWebDriver.

Maven Coordinates Selenium JUnit 4 Runner is available from Maven Central at the following coordinates:


Brian Matthews