Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to run selenium testclasses parallel using selenium grid and maven

 
kalyani kota
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

We are currently executing the Selenium test cases using maven. We have around 150Tc’s and divided them in 4 Testclasses. Now we want run these testclasses parallel using selenium grid.

My testclasses is as below:

@BeforeClass
public static void configureClassElements() {

try {
ServerSocket serverSocket = new ServerSocket(port);
serverSocket.close();
RemoteControlConfiguration rcConfig = new RemoteControlConfiguration();
rcConfig.setPort(port);
SeleniumServer server = new SeleniumServer(rcConfig);
server.boot();
server.start();
} catch (Exception e) {
e.printStackTrace();
}

}
@Test
public void testSearch() throws Exception {
selenium.open("/");
selenium.select("requestID", "label=Request ID");
selenium.type("inputText", "471");
selenium.click("go");
}
@BeforeMethod
public void configureSelenium() {
selenium = new DefaultSelenium("localhost", port, browser, url);
selenium.start();
}
@AfterMethod
public void destroyTest() {
try {

selenium.close();
selenium.stop();
} catch (InterruptedException e) {
e.printStackTrace();
}

}

In web I got dependency for grid in pom.xml as below:
<dependency>
<groupId>org.seleniumhq.selenium.grid</groupId>
<artifactId>selenium-grid-tools</artifactId>
<version>1.0.5</version>
</dependency>


How to register different rc’s to hub?


Can anybody help me, how to use selenium grid in our testclasses with maven.

Thanks in advance..
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic