Parallelism and Test drivers
Automation tests for Mobile and Web applications are generally achieved using test drivers provided by libraries like Appium/Selenium.
Test Driver for a Mobile Application and browser
Parallelism can be achieved at different levels. Consider a test suite whose composition looks like the diagram below.
With regards to parallelism, Here are important observations.
-
Individual test methods like test-1-A and test-1-B can be run parallel.
-
Tests, Test-1 and Test-2 can be run parallel. In this case, individual test methods will be run in the parent thread.
Choosing the first strategy will mean that the test driver needs to be created in the test methods to avoid thread conflicts. This is becoming counterproductive because this will lead to frequent acquisition and release of devices affecting the performance of the test.
It is hence recommended from seetest.io perspective to keep parallel execution in between tests, that is, multiple tests running in parallel which means test drivers to be setup per Test.
@BeforeClass
public void setUp(@Optional("android") String os, ITestContext testContext) {
DesiredCapabilities dc = DesiredCapabilities();
driver = os.equals("android") ?
new AndroidDriver(SeeTestProperties.SEETEST_IO_APPIUM_URL, dc) :
new IOSDriver(SeeTestProperties.SEETEST_IO_APPIUM_URL, dc);
.
.
}