Description
The API Recording feature works just like a digital record to allow API method calls to be recorded before the API scenarioRun() method is called. The Recorder is a powerful API feature because it allows Scenarios that are related to each other, via their internal Domain ancestry, to load and play recordings that will automatically set the conditions of parent and sibling Domains before the scenarioRun() method is called.
Recording Methods
- Recording Overview
- recordingNew(String recordingName, Boolean overwrite)
- recordingStart()
- recordingPause()
- recordingStop()
- recordingLoad(String recordingName)
- recordingPlay()
- recordingDelete(String recordingName)
- List<String> recordings()
- Map<String, Object> recordingShow(String recordingName)
Groovy Code Example
The example Groovy class contains two method testUserRecordingNew() and testAddressRecordLoadAndPlayback().
Method - testUserRecordingNew()
The UserScenario has the following configuration:
- Contains one Domain, User Domain
- User Domain is associated to an XMLFileReciever
- User.loopCount = 10
- User.id's RangeGen.startRange = 1
- User.emailAddress EmailGen.suffix = 'example'
Method testUserRecordingNew() will perform the following sequence of commands:
- Load the UserScenario
- Create a new Recording
- Start the Recording
- Record the api method call to set the User.loopCount = 10000
- Record the api method call to set the User.id's RangeGen.startRange = 101
- Record the api method call to set the User.emailAddress 's Generator.suffix parameter = 'gmail'
- Run the UserScenario
Method - testAddressRecordLoadAndPlayback()
The AddressScenario has the following configuration:
- Contains two Domains, the User Domain and the Address Domain
- Address Domain is associated to an SQLFileReciever
- The User Domain is the Parent to the Address Domain
- Address.user's ReferenceGen, references the User.id
- Address.emailAddress's ReferenceGen, reference the User.emailAddress
Method testAddressRecordLoadAndPlayback() will perform the following sequence of commands:
- Load the AddressScenario
- Load the GenRocket.UserRecording
- Play the recording to modify User Domain
- Run the AddressScenario
Groovy Source Code
Sample UserScenario Output (limited to 1st 5 and last 5 rows)
Sample AddressScenario Output (limited to 1st 5 and last 5 rows)