Warning: fopen(/tmp/SghXTngBZPli-ckj8M9.tmp): failed to open stream: Disk quota exceeded in /home/executea/public_html/blog/wp-admin/includes/class-wp-filesystem-ftpext.php on line 139
Warning: unlink(/tmp/SghXTngBZPli-ckj8M9.tmp): No such file or directory in /home/executea/public_html/blog/wp-admin/includes/class-wp-filesystem-ftpext.php on line 142
In the last post we discussed how selenium grid works and how to configure selenium grid in greater detail. In this post we will move further and try to run multiple tests in parallel in different environments like
Different Operating systems
Different browsers
Distributed architecture
The distributed architecture we will work will look something like this
Parallel execution
Parallel execution of test can be achieved using testing framework TestNG
In TestNG there is an option called Parallel which you can see from here
Here is the complete video of the above discussion
Here is the complete code from the above video
Parallel Execution Test Code
public class ParallelTest {
// RemotewebDriver instance
public static RemoteWebDriver driver;
@BeforeTest
@Parameters({ "platform", "browserName", "remoteurl" })
public void beforeTest(String platform, String browserName, String remoteurl)
throws MalformedURLException {
DesiredCapabilities cap = null;
if (browserName.equals("firefox")) {
cap = new DesiredCapabilities().firefox();
cap.setBrowserName("firefox");
} else if (browserName.equals("chrome")) {
cap = new DesiredCapabilities().chrome();
cap.setBrowserName("chrome");
}
cap.setPlatform(Platform.WIN8_1);
driver = new RemoteWebDriver(new URL(remoteurl), cap);
driver.navigate().to("http://www.google.com");
}
@Test
public void GoogleSearch() throws InterruptedException {
driver.findElementByName("q").sendKeys("execute automation");
driver.findElementByName("btnG").click();
Thread.sleep(3000);
}
@Test
public void ClickExecuteAutomation() {
driver.findElementByPartialLinkText("Execute Automation").click();
}
}
Thanks for reading the post and watching the video !!!
Please leave your comments and let me know if there is anything I should update in this post.
Thanks,
Karthik KK
Post Author:
Karthik kk
5 Replies to “Selenium Grid Parallel test execution”
Hi Karthik,
Topic is Selenium Grid Parallel test execution and the video is of Hidden control.
Could you please upload the video of Selenium Grid Parallel.
I am using docker for selenium grid. Parallel execution is working fine but extent report is not able to capture all test cases. It captures only last test case. Could you please advise is there a feasible solution to capture all test cases in extent report ?
Hi Karthik,
Topic is Selenium Grid Parallel test execution and the video is of Hidden control.
Could you please upload the video of Selenium Grid Parallel.
Thanks.
Thanks for reporting, I made the changes !!!
Thanks,
Karthik KK
Hi Karthik,
Could you please explain how we can achieve the same with Selenium, C# and NUnit ?
Many Thanks.
Hi Kiran,
Hope you’ve found out a way of doing it in C#! Could you please share the idea ?
Hi Karthik,
I am using docker for selenium grid. Parallel execution is working fine but extent report is not able to capture all test cases. It captures only last test case. Could you please advise is there a feasible solution to capture all test cases in extent report ?