You are on page 1of 5

Dynamic expressions

Dynamic expressions are used if values are needed for test specification that are not generated until the TestCases
have been executed.
Dynamic expressions can be used on both the Module and the TestCase level.
Examples:
• the current date
• the current first of the month
• object numbers (order number that are
created at runtime, etc.)

Syntex: {COMMAND[Parameter 1]
[Parameter 2]...[Parameter n]}
Intervals
Value intervals can be defined for specific values in order to verify values. All values within this interval are
valid.
Syntex: <Number>{INT[+/-<Interval>]}
• The value specified by <Number> defines the number to be used as a starting point for calculating the
interval. The upper and lower limit of intervals are defined under <Interval>.
• The DataType must be set to Numeric.
Calc
• PreCondition:
1. MS Excel must be installed in order to use CALC function
2. Enable “Engine Calculator”, find it in Settings->Engine->Engine Calculator: If set to Yes, local
Microsoft® Excel settings are used for calculations. If set to No, the international terms for functions and
rules apply to punctuation.

Syntex: {CALC<Operand 1><Operator><Operand 2>…<Operator><Operand n>}

The formula to be entered into an Excel cell is specified in square brackets. The four basic types of calculation (+, -,
*, /) are supported as operators. The operators are processed according to the PEMDAS rule, i.e. multiplications and
divisions are calculated before additions and subtractions, and can be modified with brackets.
If numbers with a thousands comma (digit grouping) are used, these must be put in quotation marks
(e.g. “1,234.56”).
MATH
If you do not have Microsoft® Excel installed, use the MATH function to perform your calculations. Use the
following syntax:
Syntex: {MATH[<Operand 1><Operator><Operand 2>...<Operator><Operand n>]}
Supported languages :
MATH uses English expressions. Operator Description
+, -, *, / basic arithmetic operations
Supported operands :
% Modulo operation
1. numerical values == equals
2. scientific notations != does not equal
Supported operators : && AND operation for two items
example: || OR operation for two items

The syntax {MATH[2x2+5]} returns the result 9. < less than


> greater than
The syntax {MATH[2x(2+5)]} returns the result 14.
<= less or equal
>= greater than or equal to
&, |, ^, <<, >>, Bit-wise operators: and, or, xor, left shift, right shift
!, ~ Unary operators: not, bit-wise not
Combine MATH with dynamic expressions
You can combine MATH with the following Engines 3.0 dynamic expressions:
• buffers
Name Description Example Result

• random values Abs Returns the absolute value of a specified


number.
Abs(-1) 1

• time and date expressions Ceiling Returns the smallest integer greater than
or equal to the specified number.
Ceiling(1.5) 2

Floor Returns the largest integer less than or Floor(1.5) 1

Use equal to the specified number.

mathematical Max Returns the larger of two specified


numbers.
Max(1, 2) 2

functions
Min Returns the smaller of two numbers. Min(1, 2) 1

Pow Returns a specified number raised to the Pow(3, 2) 9


specified power.

Round Rounds a value to the nearest integer or Round(3.222, 2) 3.22


specified number of decimal places.

Sign Returns a value indicating the sign of a Sign(-10) -1


number, i.e. negative values = -1, 0 = 0,
positive values = 1

Sqrt Returns the square root of a specified Sqrt(4) 2


number.

Truncate Truncates the decimal places of a value. Truncate(1.7) 1

You might also like