Run tests in parallel
Save testing time by running multiple tests, or a single test with multiple data sets, in parallel on the same host machine.
When using a seat license, you can run up to four tests in parallel (different tests or the same test with different run data).
When using concurrent licenses, additional licenses are dynamically consumed, each enabling four parallel test runs. The maximum number of licenses to consume is defined in the runtime engine settings.
Running four test operations
Run parallel testing on:
-
Native and hybrid mobile applications
-
SAPUI5-based applications
-
Web applications
Create and run your tests in a unit testing framework that supports running tests in parallel. OpenText Functional Testing for Developers supports TestNG and NUnit 3, but you can also use any custom framework that launches tests in parallel.
Tip: To minimize performance issues when testing mobile applications, lock each device once for all tests. To do this, lock the device at the beginning of the class running your tests and not before each test.
Examples
This example demonstrates how to use a data-driven TestNG test that enables running the same Web test in different types of browsers in parallel:
@DataProvider(name="BrowserTypes", parallel=true) public Object[][] getBrowserTypeData() { returnnew Object[][]{ {BrowserType.CHROME}, {BrowserType.INTERNET_EXPLORER}, {BrowserType.FIREFOX} }; } @Test(dataProvider="BrowserTypes") publicvoid parallelDataProviderTest(BrowserType browserTypeToLaunch) throws GeneralLeanFtException, ReportException { Browser browser = BrowserFactory.launch(browserTypeToLaunch); browser.navigate("www.SampleSite.com"); browser.sync(); Reporter.reportEvent("Info", "Browser launched: "+ browserTypeToLaunch + ", Thread id = " +Thread.currentThread().getId()); browser.close(); }
For more code samples, see Parallel testing code samples (Java).
To run OpenText Functional Testing for Developers tests in parallel using NUnit 3.x, add NUnit’s “[Parallelizable]” annotation on top of each class in the project that you want to run in parallel with other classes. For example:
namespace UFTDeveloperTestProject { [TestFixture] [Parallelizable] public class TestClassA : UnitTestClassBase { [Test] public void TestA() { //Write your test logic here } } [TestFixture] [Parallelizable] public class TestClassB : UnitTestClassBase { [Test]public void TestB() { //Write your test logic here } } }
Note:
-
NUnit 3.x does not support running tests within the same class in parallel, but the classes themselves can be parallelized. As a best practice, to run specific tests in parallel, give each test its own class with its own annotation.
-
If the test is configured to provide separate report files per class, a separate report is created for each parallel class run. For details, see Report settings.
In this situation, do not use multiple TestFixtures with the same name and parameters. TestFixtures must be uniquely identified to enable creating a report for each run.
-
The example above demonstrates one way of designing your NUnit 3.x projects for parallel test running. For more information, see the NUnit documentation.
See also: