Arithmetic

These keywords are helpful in performing arithmetic operations on values so that they can be used further in the test script.

Suppose you wish to add two numbers and use their resultant value further is the test case.

Structure :

addNumbersAndStore<parameters>

<further steps to execute>

rAction

Parameters

Example Usage

rAction

Parameters

Example Usage

addNumbersAndStore

Web, Mobile


To store the values after addition of the values mentioned in different parameters (mentioned in Parameter 2 to 10).

Param 1 : Variable name to store value in
Param 2 (Optional) : Number to be added
Param 3 (Optional) : Number to be added
Param 4 (Optional) : Number to be added
Param 5 (Optional) : Number to be added
Param 6 (Optional) : Number to be added
Param 7 (Optional) : Number to be added
Param 8 (Optional) : Number to be added
Param 9 (Optional) : Number to be added
Param 10 (Optional) : Number to be added

Example :

addNumbersAndStore : <In Variable : sumTotal> <Value to Add : 2> <Value to Add : 3> <Value to Add : 4> <Value to Add : 1.5> <Value to Add : > <Value to Add : > <Value to Add : > <Value to Add : > <Value to Add : >

Adds numbers 2, 3, 4 & 1.5. Stores the added value 10.5 in variable sumTotal

 

divideNumbersAndStore

Web, Mobile


To store the result into variable (variable mentioned in parameter 1) after dividing (value mentioned in Parameter2) with (value mentioned in parameter 3).

Param 1 : Variable name to store value in
Param 2 (Optional) : Number to act as dividend
Param 3 (Optional) : Number to act as divisor

Example :

divideNumbersAndStore : <In Variable : bqVariable> <Dividend : 99> <Divisor : 11>

Divides the number 99 by 11. Stores the divided value 9 in variable bqVariable.

mutiplyNumbersAndStore

Web, Mobile


To store the result into variable (variable mentioned in parameter 1) after multiply (values mentioned in Parameter2 and parameter 3).

Param 1 : Variable name to store value in
Param 2 (Optional) : Number to multiplied
Param 3 (Optional) : Number to be multiplied

Example :

multiplyNumbersAndStore : <In Variable : bqVariable> <Value 1 : 11> <Value 2 : 9>

Multiplies the number 11 & 9. Stores the multiplied value 99 in variable bqVariable.

subtractNumbersAndStore

Web, Mobile


To store the result into variable (variable mentioned in parameter 1) after subtracting (value mentioned in Parameter 3) from (value mentioned in Parameter 2). 

Param 1 : Variable name to store value in
Param 2 (Optional) : Number to subtract from
Param 3 (Optional) : Number to subtract

Example :

subtractNumbersAndStore : <In Variable : bqVariable> <Subtract From : 99> <Value to Subtract : 77>

Subtracts the number 77 from 99. Stores the subtracted value 12 in variable bqVariable.

Â