Calculations in ATS test scripts

Hey all, We would like to do some calculations in our test cases, but we do not see any actions that can do that for us. How can we handle calculations in ATS? Kathy  
1 answers

Hey Kathy,

There currently indeed isn’t a basic action in ATS that can perform these tasks. However, by using the action ‘Execute JavaScript Integer’ you can make calculations.

For example: by entering the following script you can calculate using input parameters:

X = arguments[0] + arguments[1];

return X;

This will return the sum of the input parameters ‘arguments[0]’ and ‘arguments[1]’. The same works for “-“, “/” and “*”.

If you do not want to return an integer you can use the 'Execute JavaScript String' action. With this action you can, for example, return 3.8.  

Does this help?

Kind regards,

Myrthe Walhout