Correlation Between Scripts
  • 1 Minute to read
  • Dark
    Light
  • PDF

Correlation Between Scripts

  • Dark
    Light
  • PDF

Article Summary

In this example, we will show how you can create two separate Test Automation scripts to achieve correlation - a value captured at the end of one transaction and then used in another transaction.

  1. In Fiori, using the Create Sales Order transaction, create the Sales Order, for example.

  1. In the script, after the instruction that creates the Sales Order, add a Capture screen element step, and click on the resulting Sales Order number.


  2. Save the captured Sales Order number to a new parameter. In this example, Sales Order Number.

    This is how the instruction would look like in the ScriptBuilder.

  1. Add another ScriptBuilder instruction, to set an environment variable.

  2. Give the environment variable a name, for example, Sales Order.

    Set the Value with the Sales Order Number parameter: (you will need to check mark the Expression in order to enable the parameter { } selection option) -

  3. After you run the script, from the Windows start menu, type "Edit environment variables for your account."

  4. Verify that the Sales Order variable was created and a value has been assigned to it.

Creating the 2nd Script

  1. Create a separate script, for example, transaction Manage Sales Order, that will use the captured Sales Order from the first transaction created in the previous step.

  2. In ScriptBuilder, add an instruction to “Get environment variable”.

  3. Enter the name of the environment variable you used in the first script, in this case, Sales Order, and assign the value from it to a parameter called "sales order number".

  4. Wherever you need to refer to the sales order, you will have to edit the instruction to use the "sales order number" parameter.

  5. Edit the Select item in instruction no. 10 so that it uses the "sales order number" parameter.

Result

Executing the first script will create a system variable that the second script will use.

Important!

  • Add the scripts to your test set in the correct order.

  • Tag your tests so that they always use the same Agent.