5.3. Running Thucydides in different browsers

Thucydides supports all browser-based WebDriver drivers, i.e. Firefox, Internet Explorer and Chrome, as well as HTMLUnit. By default, it will use Firefox. However, you can override this option using the webdriver.driver system property. To set this from the command line, you could do the following:

$ mvn test -Dwebdriver.driver=iexplorer

If you are not using Firefox by default, it is also useful to define this variable as a property in your Maven pom.xml file, e.g.

<properties>
    <webdriver.driver>iexplorer</webdriver.driver>
</properties>

For this to work with JUnit, however, you need to pass the webdriver.driver property to JUnit. JUnit runs in a separate JVM, and will not see the system properties defined in the Maven build. To get around this, you need to pass them into JUnit explicitly using the systemPropertyVariables configuration option, e.g.

        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
            <version>2.7.1</version>
            <configuration>
                <systemPropertyVariables>
                    <webdriver.driver>${webdriver.driver}</webdriver.driver>
                </systemPropertyVariables>
            </configuration>
        </plugin>