Pass/Fail Criteria


In the Pass/Fail Criteria view of scenario options you can add criteria for successful test execution. There are basic pass/fail criteria which are predefined in the program. Besides you can add your own specific criteria using the JavaScript functions. Your test passes if all specified criteria are met. Otherwise it fails.

New from template: Opens a dialog for adding a new pass/fail criterion based on the template.
New JavaScript function: Opens a dialog for adding a new pass/fail criterion based on the JavaScript function.
Remove: Removes a selected criterion from the list.
Edit: Opens the "Edit criterion" dialog where you can edit the selected criterion.

Check and update report: Checks the current results - whether they satisfy all specified criteria or not, and updates the report.

Basic pass/fail criteria


Click the New from template button to add a new pass/fail criterion based on the template.



You can divide the whole test time period to any number of equal intervals. Specify the necessary number of intervals. WAPT Pro will calculate the averaged data on each interval. If you do not need to divide the test time period, specify the number 1 in this field.

Select the necessary criterion in the list of predefined pass/fail criteria, for example, you can add a criterion 'Session error rate for each profile in every period should be less than 50%'. Here you can enter either an integer, or a decimal number (for example, 50.55%). The specified criterion must be fulfilled on each time interval.

Exclude periods with less than _ results: If some period contains insufficient number of results (less than the specified value), it is excluded from consideration.

Check now: Use this button to check the current results - whether they satisfy this criterion or not. If you need to check all criteria, use the button "Check and update report" in the list of all pass/fail criteria.

JavaScript criteria


Click the New JavaScript function button in the Pass/Fail Criteria view to add a new criterion based on the JavaScript function.



Enter a name for your new JavaScript criterion and specify the JavaScript code that will be executed. You can use functions defined in one of files of WAPT Pro JavaScript library. In addition to standard objects and functions, you can use the object results and its methods:

results.timeUnitLength returns the minimum time interval in seconds for which we can provide the data (time unit).

results.getProfileNumber(name_key) returns the number of profile with the name containing name_key; returns the first found result in case several results match the search condition.

results.totalProfiles the total number of profiles in the scenario.

results.totalTimeUnits the total number of the time unit intervals in the test data.

results.getRequestByName(profile_num, name_key) returns the ID of a request with the name containing the name_key; returns the first found result in case several results match the search condition.

results.getTimeUnitValueForProfile(profile_num, unit_num, val_spec) returns the value of a parameter for a time unit interval number unit_num for the profile number profile_num. Parameter val_spec can be one of the following:

"successful sessions"
"failed sessions"
"successful pages"
"failed pages"
"successful hits"
"failed hits"
"users"

results.getTimeUnitValueForRequest(request_ID, unit_num, val_spec) returns the value of a parameter for a time unit interval number unit_num for a request specified by request_ID. Parameter val_spec can be one of the following:

"min response time"
"max response time"
"average response time"
"successful pages"
"failed pages"

results.getIntervalValueForProfile(profile_num, from_sec, to_sec, val_spec) returns the value of a parameter for a specified period.

results.getIntervalValueForRequest(request_ID, from_sec, to_sec, val_spec) returns the value of a parameter for a specified period.

results.getTotalNumberOfRequests(profile_num) returns the total number of requests in the profile number profile_num.

results.getRequestByNumber(profile_num, request_num) returns the ID of a request by its number. Numeration of requests within a profile starts from 0.

results.getRequestName(request_ID) returns the name of a request.

results.getProfileName(profile_num) returns the name of a profile.

results.output(message_text) writes any text message to the custom output section attached to the generated report.

Note that the function should return zero if the criterion is passed. Otherwise, if it fails, it can return any other value, e.g. the code of error.

Results of passing the criteria are represented in the Pass/Fail Criteria table of the Summary report and HTML report.

Example of test failure:



Example of test success:

Next page