One of the major challenges with distribution testing is data-driven tests. All tests that are running simultaneously should be able to access the data.

In a few scenarios however, you cannot allow more than one test to access the same data. With data sets offered by HCL OneTest UI (HOT UI), you now have an easier way of tackling this challenge while running distributed tests.

The following terms are used in this post:

  • Data sets provide tests with variable data during a run which can be created from scratch or by importing data from a comma-separated-value (CSV) file. For details, see Dataset overview.
  • Compound tests help you organize smaller tests into scenarios that can then be run end-to-end. When you run a compound test, each test added to it is invoked in the sequence defined. For details, see Compound tests.

Creating Data sets

Let’s consider a scenario that typically happens in an e-Commerce website. A user logs in, adds products to the cart, and places an order.  Thus, the following steps make a case for automated tests:

  • login: logging in to the e-Commerce website
  • add to cart: selecting and adding products to the cart
  • place order: placing an order after confirming the product details

To accelerate testing, you plan to run all the three tests on all the supported browsers in parallel. The application however would not allow for three simultaneous sessions with same user login. Therefore, each run should use a different combination of user ID and password whereas for testing the “place order” step, you can choose the same or different product name.

For the scenario described above, create the following datasets in HCL HOTUI with the required row data:

  • DS_Login: stores user login details under two columns – user id, password
  • Dataset- DS_Login

 

  1. Dataset- DS_Login

— DS_Product: stores product details under three columns – product name, id, seller

Dataset- DS_Product

 

  1. Dataset- DS_Product

Associate DS_Login dataset with the login test and associate input values in the test with the dataset columns. Similarly, associate DS_Product dataset with the addToCart test and associate input values with the respective dataset columns. For details, see Associating a test value with a dataset column.

Creating Compound Tests

To run all the three tests together as a scenario, create a compound test called TC_PlaceOrder in HCL OneTest and add the three tests in the expected order of execution. Insert a loop within the compound test and move the addToCart test into it. This is required to fetch the values (in this case, the product details) from the rows of a corresponding dataset during execution.

 

Compound Test

 

  1. Compound Test

When you run the compound test called TC_PlaceOrder, the login test runs first to log in to the application and then the addToCart test adds products to the cart. The number of products added to the cart is equal to the iteration count specified in the loop. Lastly, the placeOrder test places an order for the products added to the cart.

Distributing Tests

To execute the test scenario on multiple browsers simultaneously, create an AFT test suite called Distribute_TC_PlaceOrder.

 

AFT Test suite

 

  1. AFT Test suite

When you run the AFT test suite called Distribute_TC_PlaceOrder, the TC_PlaceOrder test runs in Chrome and Firefox in parallel, but tests that are part of the compound test TC_PlaceOrder run sequentially.

At each step of execution in different browsers, the login test fetches the required login details from the different rows of the DS_Login dataset. This way, single user login session is ensured for each parallel test run.  After the login test is complete, the addToCart test runs in a loop (for the specified number of times) and simultaneously on different browsers. Each execution of the addToCart test accesses the DS_Productdataset, as if it is a single test accessing the dataset and adds products to the cart.

In summary, HOTUI facilitates parallel test execution by enabling simultaneous access to data while restricting it, wherever needed.

Learn how you can accelerate testing at reduced costs.

Comment wrap
Further Reading
article-img
Secure DevOps | April 2, 2021
Latest HCL OneTest Release Boasts Several Benefits, Features
The latest HCL OneTest 10.1.3 release comprises several benefits and features for continuous testing in areas such as UI, performance and API throughout project lifecycles.
article-img
Secure DevOps | March 31, 2021
Advancing Avionics Verification and Validation
Reducing delays in avionics software engineering projects is extremely difficult due to the risk of failure in the software – where an error could result in fatal loss. In fact, more than 90% of their software verification and validation projects are delivered late.
article-img
Secure DevOps | February 5, 2021
Several Updates for UI in HCL OneTest Version 10.1.2
HCL OneTest version 10.1.2 is now available. And, while it is predominantly a fix pack, our team has included some exciting new capabilities in this release. For OneTest UI users, 10.1.2 provides these following updates: New reporting framework now offers PDF export with or without details, like screenshots, where required New reporting framework now supports jumping from the report step to the test implementation step (when run from the Desktop IDE only) Application under test configuration has been simplified with a single UI for configuring Web, Android, iOS or Desktop applications Address browser compatibility issues automatically – ensure you have the right web driver for the version of the browser you’re working with and if not, install it with a single click – this helps ensure test failures aren’t related to test environment issues, but rather are representative of actual application problems Continuation of running Mobile Native and Hybrid Applications Support TechPreview with this release bringing support for iOS-based apps on real devices, simulators or device clouds Continuation of running Windows Native Applications Support TechPreview — 10.1.2 refines the way multi-window applications, dialogs and popup windows are handled. Take a deep dive on what’s new with OneTest UI here. Or watch the on-demand webinar discussing the latest release.
Close