Dynamic DPL

Dynamic DPL takes the dynamic data during runtime within the specified range. The different Methods of Dynamic DPL are.

  • Random : Syntax-"${random()}"

    Ex: ${random(10,20)} this method takes the random number and use the same in the script

  • Add : Syntax-"${add()}"

    Ex: ${add(3,4)} methods add both values mentioned(3+4=5) as an argument inside the methods and acts as value for the specified filed/Variable

  • Sub : Syntax-"${sub()}"

    Ex: ${sub(4,3)} methods subtracts the values mentioned(4-3=5) as an argument inside the methods and acts as value for the specified filed/Variable

  • Dayofmonth : Syntax-"${dayOfMonth()}"

    Retrieves the current day of month

  • Month : Syntax-"${month()}"

    This method retrieves the month of the current/specified year

  • Unique Syntax-"${unique()}"

    This method retrieves the month of the current/specified year

To use Dynamic DPL, we have to pass any of the above methods in the form of value to a variable in the CSV file. Please find the below CSV as an example.

CSV files

The steps to create Dynamic DPL for Appvance Designer Script.

  1. Create Appvance Designer Script in AIQ Example: Sahi Training site

  2. Create a CSV file for the variable username, password, and core java and ruby.

    In the above CSV file, we have used the add Method. Similarly, we can pass any method as a value to a variable based on the requirement

  3. Go to the Appvance Designer Script click the DPL option and browse for the CSV file then select any of the execution types and make the script data enabled as shown below.

  4. Save the script and create the scenario for any of the test types in Appvance Scenario Builder

  5. Go to the Test Case section and choose Appvance Designer test type and browse for the .ds file

  6. Click Resources, Add DPL, Select Dynamic DPL type as Dynamic DPL and browse for the csv file created for DPL type then choose an action for it.

  7. While running a functional test give 100 percent logs to see the output in a controller window and 5-10 percent logs while running a performance test.

  8. Save and play the created scenario. This opens the controller output tab where the results can be viewed.

    In the middle of the execution, the value 5 is getting added for the text field Ruby, where we have used the dynamic DPL, Add method as ${add(2,3)}.

Dynamic DPL takes the dynamic data during runtime within the specified range.

The Dynamic DPL engine consumes these expressions out of a CSV file, this file consists of two simple rows:

Headers row: The very first row of the CSV file must contain the headers for the generated values. These headers should match the variable name that is going to be replaced in your script.

Expressions (Data row): These are regular expressions with a very specific format used by the Dynamic DPL engine to generate the required values. The CSV must have a single data row since the Dynamic DPL engine uses a single row to generate the values, if you add any other rows they are going to be ignored, only the first one will be used.

We can use any of the below methods to create the Dynamic DPL based on your requirement

  1. Random : ${random()} ex ${random(10,20)} this method takes the random number and use the same in the script

  2. Add${add()} ex: ${add(2,3)} methods add the two values mentioned(2+3=5) in the methods and use the same value for the specified field

  3. Subtract${sub()} ex:${sub(4,3)} methods subtracts the two values mentioned(4-3=1) in the methods and use the same value for the specified field

  4. Dayofmonth retrieves the current day of the month and the syntax for that is ${dayOfMonth()}

  5. Month: This method retrieves the month of the current/specified year and the syntax is ${month()}

  6. Unique ${unique()} :

We have to pass these methods in the form of values to variables in the CSV file.

Below are the steps to create Dynamic DPL for the Designer Script

  1. Create a Designer Script in AIQ

  2. Create a CSV file for the variable CompanyName, PriceValue, and Changevalue.

    In the CSV file pass the method (like random, add, sub) based on your requirement as shown in the above screenshot

  3. Go to the Designer Script click the DPL option, then browser the CSV file and select any of the execution types and make sure the script is data enabled as shown below

  4. Save the script and create the scenario for any test type in Appvance Scenario Builder

  5. Go to the Test Case section and choose Appvance Designer Script test type and browser the .ds file

  6. Goto Resources Section and click Add Data-source. Select Dynamic Dic DPL type, Enter "DynamicDicDPL" in the name field, browse and add the above created CSV file.

    Now Navigate to the Test Case section, Click the Edit icon of Test Case, Click Add DPL, Select Dynamic DPL type and browse the CSV file created for that DPL file then choose an action for it. Actions that are available are given below with their functions

    Actions

    Generate New Dynamic Data: This action generates a new data set based on the given CSV DPL from your data source.

    Get Current Data: Retrieves the already generated data set if any, if no data set has been generated then this method will internally call "Generate New Dynamic Data" to produce a new value and set it as the current value.

  7. While running a functional test give 100 percent logs to see the output in a controller window and 5-10 percent logs while running a performance test

  8. Save and play the created scenario. This opens the controller output tab where the results can be viewed.

    In the middle of the execution, the value CO309 is getting added for the text-field Company where we have used the dynamic DPL Add method as CO${random(100,999)}

In the above screenshot, the output under Test Case execution displays the variable name, because the values will be changing dynamic if you run the Test Case for multiple users. So, to make the reports feasible the output displays the Variable name, not the value.

The values that are generated dynamically while playing the script can be seen by a user can be known by scrolling the output tab as shown below.

In the same way, unique method can also be used:

Unique Method: This takes the 30 unique characters and numbers as a value for the variable.

The syntax for unique method: ${unique()}

if the user wants to the string should start with a particular character/number or the string should end with a particular character/number the user can specify the same value as shown below.

"A${unique()}B ".