Checkpoints
Checkpoints are used to verify the expected page content. It is needed to make sure that the requested page has loaded correctly. If an HTTP request completes successfully with HTTP OK code, it does not necessarily mean that the page contents have loaded successfully. For example, a login to a web application may fail and a failed login messages may be displayed back. From HTTP perspective, the page would be successful but from application point of view, page hit may be considered a failure. A successful login may be verified by checking the received page response. The presence or absence of certain text string or text pattern may signify the success or failure of the page.
NetStorm checkpoints have been enhanced to support parameters. User can now specify the evaluated value of a parameter (as the value to look for) as the checkpoint.
Check Points can be:
- Positive check point: Searching for expected string.
- Negative check point: Searching for string which is not expected.
Checkpoint can be added from flow.c file or registrations.spec file of script. If user adds Checkpoint from flow.c file then it is also added in registrations.spec file of script. Make sure that checkpoints are added in registrations.spec file of the recorded script.
Adding Checkpoints in Script
User needs to follow the below mentioned steps for adding checkpoints in a recorded script:
- Open flow.c/registrations.spec file of script. Right click on the right pane of the file then go to Insert > Checkpoint.
- The Checkpoint Parameter window is displayed.
- Click the Add The Add Checkpoint Parameter dialog box is displayed.
- The Add Checkpoint Parameter dialog box contains following options, fill the details.
Match Criteria
- Search for Specific string: It specifies the text-string that is searched for in the received response.
- Search for string by start and end of string
- Start String: It is the left boundary for the search. This is the text immediately preceding the text string for which searching is done.
- End String: It is the right boundary for the search. This is the text immediately following the text string for which searching is done.
- Match complete response using content of a file: This is the file whose content have to compare with body content of response. File can be in both format – text and binary.
- Match Checksum
- Checksum: Here user gives checksum value which has to be compared with checksum of response.
- ChecksumCookie: Here user specifies checksum cookie name which have to be compared with ChecksumCookie of response.
Match text in page response
- All pages – To match the response in all pages
- Specified – To match the response in user specified pages
Save occurrence count in parameter
The number of matches that were found is stored in a parameter. The SaveCount argument assigns the number of matches that were found to a parameter.
Failure condition
- Match Text Not Found: Means that check point would fail if the text string or pattern were not found in the received response. If the FAIL argument is not specified, it is assumed to be NOTFOUND.
- Match Text Found: Means that check point would fail if the text string or pattern were found in the received response.
Message on failure
It is used to provide a message if checkpoint is failed.
ActionOnFail
- Stop: If string which user is searching for is not found, then NetStorm displays CVFail in report and event.log and stops the session.
- Continue: If string which user is searching for is not found, then NetStorm continues its operation.
- After filling all the required options inside the above add checkpoint parameter dialog box for checkpoints, click OK button and then click the Close An API occurs inside the registrations.spec file as below:
nsl_web_find(TEXT=”content string to be searched”, PAGE=*);
This is to search unique content of a page in string format. For verification, user can give user defined message with pass or fail status for that page after content verification is done (execution of that page by Testrun). User can verify this from Event Log with status CVFail or detail status of cvfail in Event.log file of respective TESTRUN directory with the user specified message given in checkpoint parameter GUI. User can customize the execution of a page of a script using checkpoint by making fail or pass with text found or not found options present inside the checkpoint parameter dialog box. User also can affect the execution of other pages by using the available Action option, choosing continue on page error and stop on page error.