-
Notifications
You must be signed in to change notification settings - Fork 0
How to use Dynamic Test Objects?
Dynamic test objects are values, files or business objects like orders that are created during test execution and stored during the runtime of the current XX. Best practices is to do this with a declaring instruction formulated in a passive statement:
The number of entries in the order table is stored as <order number>.
The printed PDF is stored as <Order>.
The first entry for the customer table is stored as <Customer>.
These characters within the angel brackets represent references onto the corresponding test object. This references can be used to refer to the corresponding test object in a later calling instruction:
Is the actual 'order number' increased by one?
Does the document 'Order' contain "4" pages?
Search for all orders of 'Customer'.
The characters between the apostrophes represent references to a dynamic test object defined in an earlier instruction.
This mechanism only works if the declaring and the calling statement are used in the same natural language file (nlxx or nls). However, if there is the need to declare a dynamic test object in one natural language file and to use the corresponding calling instruction in another one, then you can do the following for the calling instruction:
Search for all orders of "Customer".
In this case, the developer has to care to make this running by mapping the string "Customer" onto the customer object, which has been stored previously by the declaring statement.
Technical notes for developers:
All dynamic test objects are stored in the HashMap ExecutableExamples.testObjects. The method ExecutableExamples.storeTestObject puts a new test object into this HashMap. For each declaring statement SysNat generates a call of this method automatically. To retrieve the stored test objects in the method that implements the calling instruction, use the method ExecutableExamples.getTestObject(objectName).