0
Hi Everyone,
I want to run one testcase in two different machines parallel with different combinations of OS and Browser. But when iam running it is running in remote machine only but parallel..How to run in two machines in parallel?
I am using the below code to make it happen.
Running in Chrome browser in Remote machine in 5556 port
@Test
public void inChrome() throws MalformedURLException {
DesiredCapabilities capability = DesiredCapabilities.chrome();
// Setting the browser
capability.setBrowserName(BrowserType.CHROME);
// Setting the platform
capability.setPlatform(Platform.WINDOWS);
// Running in the remote machine.
WebDriver driver = new RemoteWebDriver(new URL(
"http://192.167.78.89:5556/wd/hub"), capability);
driver.get("https://www.google.co.in/");
driver.close();
}
// Running in firefox browser in local machine where hub is running
@Test
public void inFirefox() throws MalformedURLException {
DesiredCapabilities capability = DesiredCapabilities.firefox();
// Setting the browser
capability.setBrowserName(BrowserType.FIREFOX);
// Setting the platform
capability.setPlatform(Platform.WINDOWS);
// Running in the local machine.
WebDriver driver = new RemoteWebDriver(new URL(
"http:// :4444/wd/hub"), capability);
driver.get("https://www.google.co.in/");
driver.close();
}
and i have testing.xml file
<?xml version="1.0" encoding="UTF-8"?>
<suite name="classname" verbose="3">
<test name="Test" parallel="methods" thread-count="3">
<classes>
<class name="packagename.classname"/>
</classes>
</test> <!-- Test -->
</suite> <!-- Suite -->
當我以TestNG身份運行tests.xml文件時,兩個腳本僅在遠程計算機(192.167.78.89)上運行。 。我將如何在本地機器和遠程機器並行運行腳本。使用@Test註釋在遠程計算機和本地計算機上並行運行一個測試用例
有人可以幫我解決問題嗎?
感謝,
Sudhansu
感謝Sitam,它不工作......寫完上面的代碼後,它在本地機器上打開Chrome之後,它在遠程機器上的ff瀏覽器中打開......這不是我的要求..我需要運行腳本在遠程和本地並行執行 – user3411418