Carrying out Data Driven Testing using TestComplete (Part-II):
TestComplete is a utility tool that offers a functional automation capability as well as a user interface. In our preceding discussion, we crafted elementary Desktop and Web projects, logged our test, replayed it, and scrutinized the outcomes utilizing Visual Analyzer.
Recommended IPTV Service Providers
- IPTVGREAT – Rating 4.8/5 ( 600+ Reviews )
- IPTVRESALE – Rating 5/5 ( 200+ Reviews )
- IPTVGANG – Rating 4.7/5 ( 1200+ Reviews )
- IPTVUNLOCK – Rating 5/5 ( 65 Reviews )
- IPTVFOLLOW -Rating 5/5 ( 48 Reviews )
- IPTVTOPS – Rating 5/5 ( 43 Reviews )
In this piece, we will delve into the implementation of Data Driven Testing for both Desktop and Web-based Applications.
What You Will Acquire:
Introduction
An automated test script, be it documented or programmed, carries out a series of actions on an application to assess its functionality. Often, this identical test must be performed repeatedly with varying input data sets.
For instance, during a form test, different input data sets are typically employed to ensure robust testing of the form. This methodology of examining a functionality with multiple data sets is referred to as Data Driven Testing.
The most prevalent way to carry out data driven testing is by bringing in data from a record, for example, an Excel sheet, and employing this data in the test as a substitute for fixed values. Data driven testing is an efficient approach that saves time, augments test coverage, and ultimatively amplifies the return on investment (ROI) of Test Automation.
Enabling Data Driven Testing in Test Automation
The fundamental procedures for enabling data driven testing are as follows:
#1) Develop a test script for a specific transaction or functionality. Identify those components that require validation with multiple data sets.
#2) Evaluate the test script using fixed values/constants for one data set to verify correct functioning.
#3) Identify the optimal data input source. It could be an Excel file, a database connection, or other alternatives.
#4) Fill the selected data source with the necessary data. For example, if using an Excel sheet, input the data there. If using a database, procure the appropriate data via a query.
#5) Establish a channel between the data source and the automation script.
#6) Run the test for one or two iterations to debug and validate. It is crucial to ensure that the application under test is in the identical starting and ending condition for each iteration.
For instance, if testing a login operation with multiple credentials, confirm that the application returns to the login page after testing the first set of credentials, so the second set can be tested.
#7) Run the test for the complete data set.
#8) Enhance the test script. Once the happy path is operational, consider integrating exception handling steps.
For instance, Set out how the code should manage failures. Should it note a failure message in a log and continue to the next data set? Should it stop the test? Or should it wait for manual input, such as a click or an alert confirmation?
Enabling Data Driven Testing using TestComplete
#1) Select File | New | New Project.
#2) Define the project’s name and location (e.g., “Master Data Driven”). Click on the Next button.
#3) Specify the type of application you are dealing with. In this instance, choose Generic Windows application for a desktop-based application. Click Next.
#4) Click on the Add button and navigate to the location of the application you wish to work with. You can incorporate a sample application supplied by SmartBear.
For instance, the application can be located at the following address:
Example: C:UsersPublicDocumentsTestComplete 12 SamplesDesktopOrdersC#binReleaseOrders.exe
#5) Click Next. On this section of the wizard, you can activate or deactivate Test Visualizer as needed. Click Next.
#6) On the final section of the wizard, choose the VBScript scripting language and click on Finish.
Your project is now prepared for data driven testing using TestComplete.
Recording Test with Single Iteration
We will commence by designing a script for one iteration of our sample application. The goal is to create an order in the application using varied input values.
Pursue these steps to document the test:
#1) Navigate to Test | Record | Record Keyword. This will activate the application you wish to test.
(Note: Click on any image to magnify)
#2) The recording mode will commence, and the recording toolbar will be shown. Click on the icon (as denoted) to insert a comment.
#3) In the “Add comment” dialogue box, type in “Recording starts” and click Add.
#4) From the menu of the launched application, choose Orders | New Order. This will open the order form.
#5) Insert the comment “Enter details of the order”.
#6) Input values of your preference in the input fields.
For instance, employ the following values:
<
div id=”tablepress-127-scroll-wrapper” class=”tablepress-scroll-wrapper”>
<
table id=”tablepress-127″ class=”tablepress tablepress-id-127 tablepress-responsive”>