Documentation

GetDBData

GETDBDATA is a command that can be selected from the Actions drop down list in the test step form. This command is used to fetch the entire row from the database table. It prevents multiple calls to the DB when we want to fetch the data from the same row of the table multiple times.

We can store entire row data in a variable and use it with the help of its column name.

Syntax:

   Action                 Screen                           Element                           Parameters

GETDBDATA          ——–                      variable name                     Scriptname

Example:

   Action                       Screen                        Element                     Parameters

GETDBDATA            ——                                  x                   Sql_Server_Script_1

x has now stored all the data which is getting fetched by this (Sql_Server_Script_1) query.

In order to get the data from different columns we will use the syntax as below: Syntax: ${name of variable which has data [column name]}

Example: ${x[LastName]}

GETDBDATA syntax in case of multiple Database (when user is fetching data from second DB) will get changed a little bit.

Syntax:

   Action                   Screen          Element              Parameters

GETDBDATA          ——          variable name  DBSetting name : Scriptname

Example:

  Action              Screen            Element                Parameters

GETDBDATA        ——-             x            MY SQL Settings :Sql_Server_Script_1

In order to get the data from different columns we will use the syntax as below. Syntax: ${name of variable which has data [column name]}

We can also fetch table data present at different index in the table using below syntax

Syntax: ${var[first_name]@index=1}

Example: ${var[first_name]@index=1}

In the above snapshot, index=0 represent the first value in the last_name column, index=1 represent second value in email column and index=2 represents third value in the first_name column. So when you want to fetch first value of the column in the table you need to provide index=0, for second value index=2 and subsequently.

Was this page helpful?