I have 5 to 6 methods in a class and want to run methods in parallel on different nodes. I have grid 2 setup with 4 nodes in it.
Find below my testng.xml
<suite name="Test" parallel="methods" thread-count="2">
<test name="Test1">
<classes>
<class name="test.LoginTest"/>
</classes>
</test>
</suite>
I have a test harness, which intilizes login, common and utils class
Public class TestHarness{
public WebDriver driver = null;
public DesiredCapabilities cap = null;
public Login login;
public Common common;
public void initilize(){
cap = DesiredCapabilities.firefox();
cap.setBrowserName("firefox");
cap.setPlatform(Platform.ANY);
driver = new RemoteWebDriver(new URL(CONFIG.getProperty("hub")),cap);
common = new Common(driver);
login = new Login(driver);
utils = new Utils(driver);
}
}
In my test class I extend the test harness and in @BeforeMethod I call the intilize method
public class LoginTest extends TestHarness{
@BeforeMethod
public void startTest() {
initilize();
login.loginAsAdmin();
}
@Test
public void testLoginWithCorrectPassword(){
common.goToAdminSettings();
}
@Test
public void testLoginwithInCorrectPassword(){
utils.getMessage();
}
}
If I run the testing, I see the following problem
Two browsers are opening one in each node but only one browser launches the application and the other doesn't.
Let me know if I am missing anything?
Thank You