REST URL - Dynamic Comparison

As of Tricentis Tosca 12.2, the Webservice Engine 3.0 is no longer supported. By default, you cannot create WSE TestCases in API Scan.

For information on how to re-enable scanning WSE TestCases in API Scan, see chapter "Web service".

Dynamic parts of a URL that was previously transferred by a REST Webservice can be written to a Buffer and reused at a later point in time by using XBuffer expressions with the syntax {XB[Buffername]} (see chapter "Dynamic comparisons - XBuffer").

In this example, we assume that the URL http://www.example.com/order/9393/payments/8769 is received in Location. Using the XBuffer syntax the order ID and payment ID will be extracted and saved in Buffers:

http://www.example.com/order/{XB[orderID]}/payments/{XB[paymentID]}

In this example, the order ID 9393 is saved in the Buffer named orderID, the payment ID 8769 in the Buffer named paymentID.

Save parts of a URL in a Buffer

Dynamic comparison using regular expressions

A dynamic comparison can be carried out in a TestStepValue with regular expressions. The .NET Framework syntax is used for regular expressions.

Verify is the ActionMode being used.

Syntax:

{REGEX["expression(?<buffer name>subexpression)expression"]}

Expression: static part of the regular expression.

Buffer name: the dynamic part of the comparison is saved under this name.

Subexpression: this defines the dynamic part which should be buffered.

In this example, http://www.example.com/order/9393/ is received in Location.

The order ID 9393 will be saved to the buffer orderid. The expression <orderid>[0-9] additionally verifies whether the order ID consists solely of numbers.

{REGEX["http://www.example.com/order/(?<orderid>[0-9]*)/"]}

Buffering parts of an URL