announcement
Opkey Raises $47 Million in Series B Funding | Read more
announcement
Opkey Announces New AI-Powered Features | Read more
How can you parameterize a Test using Local Data Repository in Opkey?

How Can You Parameterize a Test Using Local Data Repository in Opkey?

March 24, 2017
 / 
by 
Iffat Ara Khanam

As we all know, Test data plays a significant role in Test Automation. You may come across many Test scenarios that needs to be parameterized. Parameterizing the Test case allows you to run the same Test Case with variable inputs, therefore increasing the coverage from a single Test value to multiple Test values.

Opkey provides an end-user friendly data storage and management feature known as Local Data Repository. Local Data Repository provides you the flexibility to add and manage data by providing features to add rows/columns, move rows or cells, Import/Export data from Excel, copy/paste the data and save it as well. The Data Repository consists of a spreadsheet which is divided into number of rows and columns. This Data Repository is used to parameterize the Test. You can add data in the corresponding rows and columns.

Data in the Local Data Repository is used during subsequent run-sessions thus, you need to be careful while entering Data in the Local Data Repository. The iteration during the run-session will work only till the time it finds data. This enables you to get a glimpse of the application behavior during multiple iterations of the same data in a single run session.

To parametrize Test Case using Local Data Repository, you need to first create a Test Case by adding subsequent Test Steps either manually or through recording. You can either create Local Data Repository file or import data from an Excel sheet (.xlsx files only) as per your convenience. Once it has been created, it can be mapped with the Test Step(s) as required.

The number of columns in the Local Data Repository is equal to the number of Test Steps in the Test Case. The Local Data Repository stores all the Static value(s) and Global variable value(s) provided initially in the Test Step(s). You can edit the Static value(s) in the Local Data Repository by clicking on the desired cell. However, the data value(s) provided with the Global variables cannot be edited. Once the Local Data Repository has been created, it can be mapped with the Test Step as per the requirements of the Test Scenario.

You have the option to fetch Data values for all the Test Steps from the Local Data Repository by default.

You can also group the Test Step(s) for execution. Row wise Execution is performed for the Test Steps involved in the Group. You can add more Test step(s) in an Existing Group. However, if you try to ungroup any Test step from the group, the entire grouping is removed.

For Example:

With reference to the screenshot given below, consider the following Test Steps:

Test step 1: OpenBrowser

Test Step 2: TypeTextInTextArea

Test Step 3: TypeTextInTextArea

Test Step 4: TypeTextInTextArea

Test Step 5: TypeTextInTextArea

Test Step 1: Opens the given url on specified browser.

Test Step 2, 3, 4,5  : Types the specified text in a given Text area.

Let us create a Group for Test Step 2,3,4. To do so,

  • Press Ctrl and click on the Test Steps 2,3,4
  • Right click on it.
  • Click Create New Group.
  • Test Steps 2, 3, 4 will be combined within a Group as shown below:

Now, let us provide data through Local Data Repository as shown:

Here, Iteration Count =3

Suppose, Test Steps 2, 3, 4 are combined in a group.

Row wise Execution will take place for the group [Test Step 2, 3, 4]

For Test Step 1 and 5 the execution will be column wise.

When the Test Case is executed, the input values for Test steps  are taken from Local Data Repository in the following sequence.

Test Step1

Iteration 1: Opens the given url on the specified browser.

For the Group

               Test Step 2                Test Step 3           Test Step 4Iteration 1:       Iphone AppleDellIteration 2:       Nexus 5Microsoft HPIteration 3:       Galaxy S5GoogleLenova

Test Step 5

Iteration 1: Toys

Iteration 2: Doll

Iteration 3: Teddy Bear

Explanations:

Since a single value is provided for the Test Step 1, only 1 iteration will be performed for the Test Step 1. So in this case, Test Step 1 will be executed and will open the given url on the specified browser. Once the execution is completed for Test Step 1, the execution moves to the Group [Test Step 2, 3, 4].

Now, Row wise execution will take place for the Test Steps combined in the Group. Since Test Step 2,3,4  are grouped together, they are executed in a row.During the first iteration, the input values will be taken from the first row of the group i.e  Input value for Test Step 2,3,4 will be IphoneAppleDell respectively. Similarly, the other two iterations will take place. Once all the 3 Iterations are completed for the Group, the execution moves to the Test Step 5.

During the  first Iteration of  Test Step 5 , Input value will be taken as Toys. Similarly, for the second and third iteration input values will be DollTeddy Bear respectively.You can also ungroup the Test Step(s) which were grouped together.

In this way, you can parameterize a Test using Local Data Repository in Opkey.

Author

Priyanshi Saxena

Contact us