Hi,
can u tell me how can we run a testng test parallely in remote machines with out giving parameters in xml because xml use is good for small number of testcases but i have a test case which i have to run on 20 machines.and i am using testng+selenium+eclipse environment and not able to run my test parallely.itz running sequentially and atacking only one host machine.
i created 20 instances using @factory annotation to run on 20 machines but itz creating 20 instances in my machine thats bz itz not able to catch other host machine ip's.may be i am missing something.would really appreciate if u can provide sm solution to this.
here is my test:
import com.thoughtworks.selenium.;
import org.testng.annotations.;
public class Xampperf02
{
private Selenium selenium;
@BeforeClass
@Parameters({"selenium.host","selenium.port","selenium.browser","selenium.url",})
public void startSelenium(String host, String port, String browser, String url) {
this.selenium = new DefaultSelenium(host, Integer.parseInt(port), browser, url);
this.selenium.start();
this.selenium.open(url);
}
@AfterClass(alwaysRun=true)
public void stopSelenium() {
this.selenium.stop();
}
@Test(invocationCount=2)
public void testXampperf02() throws Exception {
selenium.open("http://202.53.87.166/xampperf/index.html");
selenium.click("link=Login");
selenium.waitForPageToLoad("30000");
String loginID = selenium.getExpression("login");
selenium.type("login", selenium.getEval("'" + loginID + "'+Math.round((3790-3741) * Math.random() + 3741)"));
selenium.type("password", "password");
selenium.click("Submit");
selenium.waitForPageToLoad("30000");
selenium.click("link=Total Members list");
selenium.waitForPageToLoad("30000");
selenium.click("link=Logout");
selenium.waitForPageToLoad("30000");
selenium.click("link=Login");
selenium.waitForPageToLoad("30000");
}
}
My factory classs is as follows:(here i am creating 20 instances of my test class Xampperf02()
import org.testng.annotations.Factory;
import org.testng.annotations.Test;
@Test
public class Factory1
{
@Factory
public Object[] createInstances()
{
return new Object[] {new Xampperf02(),
new Xampperf02(),
new Xampperf02(),
.
.
.
new Xampperf02(),
};
}
}
and here goes my xml file:
............(20 ips of differnt host)
.
In the xml file,i am passing 20 ip values but my test is detecting only one ip and creating all 20 instances in that single host machine leaving remaining 19 ip's in idle.