For many organizations, defining test processes to keep up with agile and continuous software delivery trends is a huge challenge.
And to overcome the challenge, many software teams typically go for test automation or introduce additional scripting. However, more automated UI tests might not always equate to efficient processes.
Test execution times are directly proportional to the size of testing suites. Especially in such scenarios, the very purpose of automating the tests gets defeated. This post outlines how HCL OneTest UI (HOT UI) can help you overcome the most common issues associated with test automation.
The following terms are used in this blog post:
- Node – A physical or virtual machine, a Docker image, a mobile device, or an emulator
- Channel – An active instance of a browser on which a test runs
Speed it up, not slow down
The most powerful way of expediting tests is to run them in parallel. Instead of running all the test scripts on a single node, distribute them across many nodes – this reduces the execution time by nearly X times, where X represents the number of nodes on which you run the tests. For instance, if you run 100 tests on more than 10 nodes in parallel, the execution time can reduce to just one tenth of the actual execution time.
In addition to saving time, parallelizing test execution also allows for a significant uptick in the test coverage.
Consider the following requirements when you are gearing up for running automated tests in parallel:
- Atomic and autonomous tests
- Test environments where the communication between nodes are properly handled
- A single consolidated report for test execution
- A prompt and accurate way of managing test data
Accelerating the test execution
HCL Software offers a GUI automation functional testing tool called HCL OneTest UI that helps you quickly generate test scripts for automated testing by recording. These test scripts can be run both sequentially and parallelly. Using its simple UI, you can generate atomic scripts for parallel test execution (see Splitting a test during recording), exploit a variety of features for parallel test execution and automatic management of test data.
The HCL OneTest UI helps you accelerate testing by providing ways to distribute test execution across multiple browsers and multiple nodes simultaneously (see Accelerating the test effort with distributed testing). To run parallel testing in HOTUI, you need accelerated functional test assets (AFT) to be set up. AFT is an XML file which contains all the required information for parallel test execution on multiple connected nodes and available browsers:
- Test scripts details: Name and location of all the test scripts to be run in parallel
- Browser Details ….: The browsers on which the tests run
- Locations ……………: The location of nodes on which the tests are run
- Group …………………: Group of tests, browsers, and location
A typical AFT test suite looks like this:
- AFT Test suite
For details on how to set up an accelerated functional test, see Creating an accelerated functional test asset.
Controlling the distribution of test execution
Running an AFT test suite distributes the WebUI tests that are part of it across multiple connected nodes which facilitate several channels (or streams) for running tests in parallel. The number of tests that can run on a node in parallel is dependent on the number of channels you define in the HOTUI preferences, by setting “Number of parallel channels per agent for distribution” to an integer value in Web UI Playback (Desktop) Preferences (Window > Preferences > Test > Test Execution > Web UI Playback (Desktop)).
- HOTUI preferences- To set no of parallel test run
Hence, when you determine the count pf parallel channels, you should keep in mind the configuration of the connected nodes as well.
You can distribute parallel tests execution in HOTUI in the following ways:
- Automatic distribution
The distribution of tests for execution is completely controlled by HOTUI in view of minimizing execution time. The selected WebUI tests or tests part of an AFT suite are pre-arranged into the specified number of channels based on the execution times of individual tests, thus balancing the total execution time for each channel.
- Selective distribution
You can decide which tests are executed on which connected node and on which browser by creating groups. All tests that are part of a group run on all the browsers in that are associated with that group and execution is distributed on all nodes defined therein.
If the number of selected tests or the number of tests that are part of an AFT test suite is greater than the number of available channels, each channel can be configured to accommodate multiple Web UI tests. The Web UI tests run parallelly across channels, and sequentially within a channel.
Maximum number of tests that can run in parallel = (Number of parallel channels per node for distribution) X (Number of connected nodes)
Note: If you run compound tests, the number of compound tests multiplied by the number of selected browsers must not exceed the number of channels.
Viewing the reports
At the end of the test execution, a report is generated (see screenshot) with the details and summary of execution, for example, details of the tests, execution environment, status, and location (node details).
- Report- Parallel Test run
- Report Expanded- Parallel Test run
Learn how easy it is to accelerate data-driven tests.