This is a JUnit 4 class runner that:
The code snippet below shows the step up and tear down required to create an integration test without the Selenium JUnit 4 Class Runner:
public void class GoogleHomePageITCase {
private static Selenium server;
@BeforeClass
public void start() {
server = new DefaultSelenium("localhost", 4444, "http://www.google.com", "*firefox");
server.start();
}
@AfterClass
public void stop() {
server.stop();
}
.
.
.
}The code snippet below demonstrates how the same can be achieved more cleanly with the Selenium JUnit 4 Class Runner:
@RunWith(SeleniumJUnit4ClassRunner.class)
@ServerConfiguration(browserURL = "http://www.google.com")
public void class GoogleHomePageITCase {
@SeleniumServer
public Selenium server;
.
.
.
}More detailed on how to use the Selenium JUnit 4 Class Runner can be found here.
To provide you with better understanding of some usages of the Selenium JUnit 4 Class Runner, you can take a look into the following examples: