The Now Platform® Washington DC release is live. Watch now!

Help
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
ryanpalmer
ServiceNow Employee
ServiceNow Employee

Introduction

Sometimes it may be desirable to inspect a record or records created as part of an ATF test after that test is complete. Since all data created within an ATF test will be rolled back upon completion, this data will not be available for review once the test is finished. However, it is possible to trick the ATF into giving you some extra time (up to about 10 minutes) to review this data before rolling it back. The trick is to add a validation step at the end of your test that will fail, and give it a timeout suitable for your needs. As long as the validation evaluates to false, the test will wait patiently until the timeout. By default, you can set the timeout to a maximum of 590 seconds (9.83 minutes). When you are done evaluating the record, you can simply update it so that the validation will succeed, and the test will proceed to completion.

Example Steps

  1. Create a new ATF test.
  2. Add a new "Record Insert" test step with the following values:
    • Table: Task
    • Field values: Short Description = "ATF Record"

    find_real_file.png

  3. Add a new "Record Validation" test step with the following values:
    • Timeout: 590 seconds
    • Table: Task
    • Record: Step 1: Record Insert > Record
    • Field values: Short Description is "nothing"

    find_real_file.png

  4. Run the test.
    find_real_file.png

  5. Once the test reaches the validation step, search the Task table for your record by searching for the "ATF Record" short description. find_real_file.png

  6. Open the record and inspect it.
    find_real_file.png

  7. When you're finished inspecting, simply update the short description to "nothing" to satisfy our validation and dismiss the record.
    find_real_file.png

  8. Observe the test completes successfully.
    find_real_file.png

Notes

You can set up multiple validations to inspect multiple records created by the same test. Technically, you could use a single validation step to inspect all records, but creating a different validation for each record allows you to inspect and dismiss them one by one, each with their own timeout of up to 590 seconds. If using multiple validations, make sure to dismiss them in the same order that you configured the steps. That way, the test can pass each validation in sequence. If you spend too much time inspecting, the validation may timeout and the test will report failure.

10 Comments