Course - Automated Test Framework - ServiceNow Developers
Course - Automated Test Framework - ServiceNow Developers
Course - Automated Test Framework - ServiceNow Developers
Version: Rome
Course Information:
The Automated Test Framework (ATF) is a ServiceNow application to
test within a ServiceNow instance. ATF can be used for regression
testing, test driven development, or other ServiceNow testing
requirements.
Modules
Tests
https://developer.servicenow.com/print_page.do?release=rome&category=courses&identifier=app_store_learnv2_atf_rome_automated_test_fr… 1/141
10/28/22, 7:33 AM Course | Automated Test Framework - ServiceNow Developers
Debugging Tests
ATF Variables
Test Templates
https://developer.servicenow.com/print_page.do?release=rome&category=courses&identifier=app_store_learnv2_atf_rome_automated_test_fr… 2/141
10/28/22, 7:33 AM Course | Automated Test Framework - ServiceNow Developers
Test Suites
Parameterized Tests
Scheduling
Create a Schedule
https://developer.servicenow.com/print_page.do?release=rome&category=courses&identifier=app_store_learnv2_atf_rome_automated_test_fr… 3/141
10/28/22, 7:33 AM Course | Automated Test Framework - ServiceNow Developers
https://developer.servicenow.com/print_page.do?release=rome&category=courses&identifier=app_store_learnv2_atf_rome_automated_test_fr… 4/141
10/28/22, 7:33 AM Course | Automated Test Framework - ServiceNow Developers
IMPORTANT: The content in this learning module was last updated for the
https://developer.servicenow.com/print_page.do?release=rome&category=courses&identifier=app_store_learnv2_atf_rome_automated_test_fr… 5/141
10/28/22, 7:33 AM Course | Automated Test Framework - ServiceNow Developers
https://developer.servicenow.com/print_page.do?release=rome&category=courses&identifier=app_store_learnv2_atf_rome_automated_test_fr… 6/141
10/28/22, 7:33 AM Course | Automated Test Framework - ServiceNow Developers
Tests
An ATF test is an automated, ordered sequence of steps in
ServiceNow. Steps define the actions to take and the order in which
they execute. ATF executes the steps and reports the status of each
step as well as the overall status of the test.
https://developer.servicenow.com/print_page.do?release=rome&category=courses&identifier=app_store_learnv2_atf_rome_automated_test_fr… 7/141
10/28/22, 7:33 AM Course | Automated Test Framework - ServiceNow Developers
https://developer.servicenow.com/print_page.do?release=rome&category=courses&identifier=app_store_learnv2_atf_rome_automated_test_fr… 8/141
10/28/22, 7:33 AM Course | Automated Test Framework - ServiceNow Developers
https://developer.servicenow.com/print_page.do?release=rome&category=courses&identifier=app_store_learnv2_atf_rome_automated_test_fr… 9/141
10/28/22, 7:33 AM Course | Automated Test Framework - ServiceNow Developers
Click the link in a test record to enable running tests, or use the
Application Navigator to open Automated Test Framework (ATF) >
Administration > Properties.
IMPORTANT: As with all testing, run ATF tests only on development or testing
To execute an ATF test on-demand, open the test record, then click
the Run Test button.
https://developer.servicenow.com/print_page.do?release=rome&category=courses&identifier=app_store_learnv2_atf_rome_automated_test_f… 10/141
10/28/22, 7:33 AM Course | Automated Test Framework - ServiceNow Developers
If the test steps include client-side actions such as opening a form, the
test executes in a client test runner. A client test runner is the runtime
environment for client-side tests. The client test runner executes the
test steps as a specific user using the browser (for example, Chrome
or Firefox) in which the client test runner is launched.
https://developer.servicenow.com/print_page.do?release=rome&category=courses&identifier=app_store_learnv2_atf_rome_automated_test_f… 11/141
10/28/22, 7:33 AM Course | Automated Test Framework - ServiceNow Developers
NOTE: Client tests execute faster when the client test runner is the foreground
window or tab.
When the client test runner finishes executing the current test, it briefly
displays the text Finished text execution, reporting result then returns
to saying Waiting for a test to run. The client test runner remains active
and waits for another test to run. Closing the browser tab terminates
the client test runner. ATF administrators manage client test runners
using the Automated Test Framework (ATF) > Administration > All
Test Runners module.
https://developer.servicenow.com/print_page.do?release=rome&category=courses&identifier=app_store_learnv2_atf_rome_automated_test_f… 12/141
10/28/22, 7:33 AM Course | Automated Test Framework - ServiceNow Developers
Monitor the test progress for both client-side and server-side tests in
the ServiceNow window used to launch the test.
After tests execute, ATF rolls back (undoes) data modified during test
execution, except for records in:
History [sys_history_line]
ECC Queue [ecc_queue]
Email [sys_email]
Email Log [sys_email_log]
Report Executions [report_executions]
Report Stats [report_stats]
Any table that extends these tables
https://developer.servicenow.com/print_page.do?release=rome&category=courses&identifier=app_store_learnv2_atf_rome_automated_test_f… 13/141
10/28/22, 7:33 AM Course | Automated Test Framework - ServiceNow Developers
The test results record displays the test result, test step results, test
log, and transactions involved in executing the test.
https://developer.servicenow.com/print_page.do?release=rome&category=courses&identifier=app_store_learnv2_atf_rome_automated_test_f… 14/141
10/28/22, 7:33 AM Course | Automated Test Framework - ServiceNow Developers
Screenshots
If enabled, screenshots are captured during test execution and
attached to the test result record. This property is enabled by default.
To change the property's value, use the Application Navigator to open
Automated Test Framework (ATF) > Administration > Properties.
Click the [download] link in the test result record to download and
view a screenshot.
https://developer.servicenow.com/print_page.do?release=rome&category=courses&identifier=app_store_learnv2_atf_rome_automated_test_f… 15/141
10/28/22, 7:33 AM Course | Automated Test Framework - ServiceNow Developers
Test Steps
Use the Step Results related list to view the results for a specific test
step. Click the link in the Start time column to open the Test Step
record.
For example, clicking the link for the Impersonate step result opens
the impersonate step result record.
https://developer.servicenow.com/print_page.do?release=rome&category=courses&identifier=app_store_learnv2_atf_rome_automated_test_f… 16/141
10/28/22, 7:33 AM Course | Automated Test Framework - ServiceNow Developers
Test Log
Use the Test Log related list to see the logging information for the test
and all test steps.
Test Transactions
Use the Test Transactions related list to view the transactions for the
test steps. The transactions shown here are browser (client-side)
interactions with ServiceNow.
Debugging Tests
https://developer.servicenow.com/print_page.do?release=rome&category=courses&identifier=app_store_learnv2_atf_rome_automated_test_f… 17/141
10/28/22, 7:33 AM Course | Automated Test Framework - ServiceNow Developers
https://developer.servicenow.com/print_page.do?release=rome&category=courses&identifier=app_store_learnv2_atf_rome_automated_test_f… 18/141
10/28/22, 7:33 AM Course | Automated Test Framework - ServiceNow Developers
https://developer.servicenow.com/print_page.do?release=rome&category=courses&identifier=app_store_learnv2_atf_rome_automated_test_f… 19/141
10/28/22, 7:33 AM Course | Automated Test Framework - ServiceNow Developers
In this exercise, you will run two example ATF tests: Simple UI Test
and Fails Because no Form is Open. You will also examine the test
results.
NOTE: If your PDI automatically opens App Engine Studio, you need to
change the user role used to access the PDI. To complete the exercises,
(https://developer.servicenow.com/dev.do#!/guides/rome/developer-program/pdi-
guide/managing-your-pdi#changing-your-instance-user-role).
Preparation
1. Use the Application Navigator to open User Administration >
Users.
2. If the column search row is not already visible, click the Show
https://developer.servicenow.com/print_page.do?release=rome&category=courses&identifier=app_store_learnv2_atf_rome_automated_test_f… 20/141
10/28/22, 7:33 AM Course | Automated Test Framework - ServiceNow Developers
3. Scroll to the Test Steps related list. Examine the six steps to make
sure you understand what they test.
4. Execute the test steps manually to see what the test does and get
a sense of the time savings from using ATF.
https://developer.servicenow.com/print_page.do?release=rome&category=courses&identifier=app_store_learnv2_atf_rome_automated_test_f… 21/141
10/28/22, 7:33 AM Course | Automated Test Framework - ServiceNow Developers
https://developer.servicenow.com/print_page.do?release=rome&category=courses&identifier=app_store_learnv2_atf_rome_automated_test_f… 22/141
10/28/22, 7:33 AM Course | Automated Test Framework - ServiceNow Developers
4. The User ID, Email, and First Name fields should not be
mandatory. Recall that mandatory fields are preceded by
an asterisk.
5. If you are able to capture screenshots, take a
screenshot of the form.
7. Click the Submit button.
8. Re-open the Test Testing user form from the list.
9. If you are able to capture screenshots, take a screenshot of
the Test Testing User form.
10. Roll back the test steps by deleting the test.testing user
record and returning to the admin user.
1. On the Test Testing user record form, click the Delete
button.
2. In the delete Confirmation dialog, click the Delete
button.
3. Open the User menu by clicking Fred Luddy in the
banner and select the End Impersonation menu item.
5. Stop the timer. Note how long it took to complete the test steps.
https://developer.servicenow.com/print_page.do?release=rome&category=courses&identifier=app_store_learnv2_atf_rome_automated_test_f… 23/141
10/28/22, 7:33 AM Course | Automated Test Framework - ServiceNow Developers
4. Click the Enable tests and test suites here link. If you have
already enabled running tests, you are not prompted again.
https://developer.servicenow.com/print_page.do?release=rome&category=courses&identifier=app_store_learnv2_atf_rome_automated_test_f… 24/141
10/28/22, 7:33 AM Course | Automated Test Framework - ServiceNow Developers
https://developer.servicenow.com/print_page.do?release=rome&category=courses&identifier=app_store_learnv2_atf_rome_automated_test_f… 25/141
10/28/22, 7:33 AM Course | Automated Test Framework - ServiceNow Developers
1. The Run Test dialog should indicate that all steps were
successful.
https://developer.servicenow.com/print_page.do?release=rome&category=courses&identifier=app_store_learnv2_atf_rome_automated_test_f… 26/141
10/28/22, 7:33 AM Course | Automated Test Framework - ServiceNow Developers
https://developer.servicenow.com/print_page.do?release=rome&category=courses&identifier=app_store_learnv2_atf_rome_automated_test_f… 27/141
10/28/22, 7:33 AM Course | Automated Test Framework - ServiceNow Developers
DEVELOPER TIP: Include the expected test outcome in the Description field.
Click the Save button. The form displays the Test Steps, Test Results,
and Mutually Exclusive Tests related lists.
https://developer.servicenow.com/print_page.do?release=rome&category=courses&identifier=app_store_learnv2_atf_rome_automated_test_f… 28/141
10/28/22, 7:33 AM Course | Automated Test Framework - ServiceNow Developers
https://developer.servicenow.com/print_page.do?release=rome&category=courses&identifier=app_store_learnv2_atf_rome_automated_test_f… 29/141
10/28/22, 7:33 AM Course | Automated Test Framework - ServiceNow Developers
rest-category.html)
Responsive Dashboards
Email (https://docs.servicenow.com/bundle/rome-application-
development/page/administer/auto-test-framework/reference/test-steps-
email-category.html#test-steps-email-category)
Reporting
Server (https://docs.servicenow.com/bundle/rome-application-
development/page/administer/auto-test-framework/reference/test-steps-
server-category.html)
Select a test step to add to the test then click the Next button.
In the Add Test Step dialog, configure the step. The step fields depend
on the selected test.
https://developer.servicenow.com/print_page.do?release=rome&category=courses&identifier=app_store_learnv2_atf_rome_automated_test_f… 30/141
10/28/22, 7:33 AM Course | Automated Test Framework - ServiceNow Developers
Execution Order
The execution order determines the order in which test steps execute.
By default, the order is the order in which the steps are added to the
test.
When adding test steps to a test, use the Insert after choice list to
place the step in the desired location.
https://developer.servicenow.com/print_page.do?release=rome&category=courses&identifier=app_store_learnv2_atf_rome_automated_test_f… 31/141
10/28/22, 7:33 AM Course | Automated Test Framework - ServiceNow Developers
After creating test steps, use the Execution order field to renumber the
step that is out of order. Save the form and the other test steps are
automatically re-ordered based on the change you made.
test step to make sure the test steps work as expected for users other than an
administrator.
https://developer.servicenow.com/print_page.do?release=rome&category=courses&identifier=app_store_learnv2_atf_rome_automated_test_f… 32/141
10/28/22, 7:33 AM Course | Automated Test Framework - ServiceNow Developers
Preparation
1. Use the Application Navigator to open Incident > Open.
2. If the column search row is not already visible, click the Show
Create a Test
1. Use the Application Navigator to open Automated Test
Framework (ATF) > Tests.
2. Click the New button.
3. Configure the test:
Name: Validate Email Incident
Description: Open existing Incident record, validate the
Short description contains the string email, and verify
the Update button is visible.
4. Click the Save button.
https://developer.servicenow.com/print_page.do?release=rome&category=courses&identifier=app_store_learnv2_atf_rome_automated_test_f… 33/141
10/28/22, 7:33 AM Course | Automated Test Framework - ServiceNow Developers
https://developer.servicenow.com/print_page.do?release=rome&category=courses&identifier=app_store_learnv2_atf_rome_automated_test_f… 34/141
10/28/22, 7:33 AM Course | Automated Test Framework - ServiceNow Developers
4. Click the Run button to apply the filter to the Incident list.
4. Choose a record from the filtered list by clicking a record
number.
5. Click the OK button.
8. Read the annotation for the Record field.
1. In the Test Steps related list, click the Add Test Step button.
https://developer.servicenow.com/print_page.do?release=rome&category=courses&identifier=app_store_learnv2_atf_rome_automated_test_f… 35/141
10/28/22, 7:33 AM Course | Automated Test Framework - ServiceNow Developers
4. Read the test step explanation to understand what the test step
does.
Depending on the values in your incidents, you may need to adjust your
https://developer.servicenow.com/print_page.do?release=rome&category=courses&identifier=app_store_learnv2_atf_rome_automated_test_f… 36/141
10/28/22, 7:33 AM Course | Automated Test Framework - ServiceNow Developers
5. The filter should return one result. Select the record to add it
to the list of UI Actions which should be visible on the form
during the test step.
https://developer.servicenow.com/print_page.do?release=rome&category=courses&identifier=app_store_learnv2_atf_rome_automated_test_f… 37/141
10/28/22, 7:33 AM Course | Automated Test Framework - ServiceNow Developers
1. The Run Test dialog should indicate that all steps were
successful.
2. Click the Go to Result button.
1. Scroll to the Step Results related list. All three steps should
have completed successfully.
https://developer.servicenow.com/print_page.do?release=rome&category=courses&identifier=app_store_learnv2_atf_rome_automated_test_f… 38/141
10/28/22, 7:33 AM Course | Automated Test Framework - ServiceNow Developers
NOTE: If the Field Values Validation test step failed, it may be due
to the test step being case sensitive. The Field Values Validation
2. Open the Test Log related list and scroll through the logging
information.
Challenge
Modify the Validate Email Incident test so it executes all test steps as
a user with the admin role. Run the test and examine the results to
make sure the test is still successful. If you get stuck, you can view the
challenge solution.
https://developer.servicenow.com/print_page.do?release=rome&category=courses&identifier=app_store_learnv2_atf_rome_automated_test_f… 39/141
10/28/22, 7:33 AM Course | Automated Test Framework - ServiceNow Developers
CHALLENGE SOLUTION:
The first step in the Validate Email Incident test should be to Create a
User. The user can have any name. The user should be configured
with the admin role and the Impersonate this user field should be
Selected (checked).
https://developer.servicenow.com/print_page.do?release=rome&category=courses&identifier=app_store_learnv2_atf_rome_automated_test_f… 40/141
10/28/22, 7:33 AM Course | Automated Test Framework - ServiceNow Developers
ATF Variables
ATF uses variables to pass data from one test step to another. There
are two types of variables:
Input
Output
Input Variables
Input variables provide test steps with the information they need to
run. Developers provide values for input variables when configuring a
test step. For example, the Create a User test step has five input
variables: First name, Last name, Roles, Groups, and Impersonate
this user.
Output Variables
https://developer.servicenow.com/print_page.do?release=rome&category=courses&identifier=app_store_learnv2_atf_rome_automated_test_f… 41/141
10/28/22, 7:33 AM Course | Automated Test Framework - ServiceNow Developers
Test step fields that accept output variables as their input have a Data
Pill Picker button.
The Data Pill Picker button opens a list of steps with output variables
available for use with input variables.
https://developer.servicenow.com/print_page.do?release=rome&category=courses&identifier=app_store_learnv2_atf_rome_automated_test_f… 42/141
10/28/22, 7:33 AM Course | Automated Test Framework - ServiceNow Developers
Dot-walking
https://developer.servicenow.com/print_page.do?release=rome&category=courses&identifier=app_store_learnv2_atf_rome_automated_test_f… 43/141
10/28/22, 7:33 AM Course | Automated Test Framework - ServiceNow Developers
https://developer.servicenow.com/print_page.do?release=rome&category=courses&identifier=app_store_learnv2_atf_rome_automated_test_f… 44/141
10/28/22, 7:33 AM Course | Automated Test Framework - ServiceNow Developers
2. Add a Set Field Values test step after the existing Field Values
Validation test step.
1. In the Test Steps related list, click the Add Test Step button.
2. In the Insert after choice list, select the Step 3 - Field Values
Validation test step.
3. In the categories pane, select the Form category.
4. In the test steps pane, select Set Field Values.
5. Click the Next button.
3. Set the Caller field value to the User output variable from the
Create a User step.
1. Click the Data Pill Picker button ( ) for the Caller field.
2. Click Step 1: Create a User.
3. Click User.
4. Examine the syntax in the Caller field to make sure you
understand it.
https://developer.servicenow.com/print_page.do?release=rome&category=courses&identifier=app_store_learnv2_atf_rome_automated_test_f… 45/141
10/28/22, 7:33 AM Course | Automated Test Framework - ServiceNow Developers
1. The Run Test dialog should indicate that all steps were
successful.
2. Click the Go to Result button.
1. Scroll to the Step Results related list. All steps should have
completed successfully.
2. Examine the summary for the Set Field Values test to verify
the caller_id field value matches the user created in test step
1.
https://developer.servicenow.com/print_page.do?release=rome&category=courses&identifier=app_store_learnv2_atf_rome_automated_test_f… 46/141
10/28/22, 7:33 AM Course | Automated Test Framework - ServiceNow Developers
Test Templates
An ATF test template is a reusable set of test steps that are commonly
used together. Test Templates can include any combination of test
steps. A template's test steps may require additional configuration
once added to a test.
To add a test template to a test, click the Add Test Template button in
the Test Steps related list for a test. Select a template. If prompted,
provide other variable values. Variable values requested depend on
the test steps in the template. Click the Add button.
https://developer.servicenow.com/print_page.do?release=rome&category=courses&identifier=app_store_learnv2_atf_rome_automated_test_f… 47/141
10/28/22, 7:33 AM Course | Automated Test Framework - ServiceNow Developers
The template populates the Description field based on the test steps
from the template. The description includes instructions to the
developer explaining what must be done to the template's test steps to
make the template steps work. If the Description field had a value
before the template was added to the test, the template steps and
instructions are appended to the existing Description field value.
https://developer.servicenow.com/print_page.do?release=rome&category=courses&identifier=app_store_learnv2_atf_rome_automated_test_f… 48/141
10/28/22, 7:33 AM Course | Automated Test Framework - ServiceNow Developers
The template's test steps are added to the Test Steps related list. Edit
and delete steps added from a template using the same strategies
used for individually added test steps. For example, if only six of the
eight test steps added by a template are required for a test, a
developer can add the test steps using a template, then delete the
unnecessary test steps from the test. In the example, the test does not
need to verify UI Action Visibility. The UI Action-related test steps can
be deleted without deleting all test steps added by a template.
https://developer.servicenow.com/print_page.do?release=rome&category=courses&identifier=app_store_learnv2_atf_rome_automated_test_f… 49/141
10/28/22, 7:33 AM Course | Automated Test Framework - ServiceNow Developers
To add test steps using the slushbucket, select a test then click the
https://developer.servicenow.com/print_page.do?release=rome&category=courses&identifier=app_store_learnv2_atf_rome_automated_test_f… 50/141
10/28/22, 7:33 AM Course | Automated Test Framework - ServiceNow Developers
on how ServiceNow uses GitHub with the Developer Program learning content
https://developer.servicenow.com/print_page.do?release=rome&category=courses&identifier=app_store_learnv2_atf_rome_automated_test_f… 51/141
10/28/22, 7:33 AM Course | Automated Test Framework - ServiceNow Developers
IMPORTANT: If you have already forked and imported the repository, you can
proceed to the next exercise, where you will create a branch from a tag to load
the application files to your PDI. The NeedIt application files are needed to
https://developer.servicenow.com/print_page.do?release=rome&category=courses&identifier=app_store_learnv2_atf_rome_automated_test_f… 52/141
10/28/22, 7:33 AM Course | Automated Test Framework - ServiceNow Developers
6. Select your personal GitHub account as the fork Owner, then click
the Create fork button.
7. Verify the URL for your fork of the repository is similar to:
<YourGitHubUsername>/devtraining-application-release.
https://developer.servicenow.com/print_page.do?release=rome&category=courses&identifier=app_store_learnv2_atf_rome_automated_test_f… 53/141
10/28/22, 7:33 AM Course | Automated Test Framework - ServiceNow Developers
NOTE: You will use the copied URL to configure the connection to
https://developer.servicenow.com/print_page.do?release=rome&category=courses&identifier=app_store_learnv2_atf_rome_automated_test_f… 54/141
10/28/22, 7:33 AM Course | Automated Test Framework - ServiceNow Developers
1. Log in to your PDI as the admin user. If you do not have a PDI,
open the ServiceNow Developer Site
(https://developer.servicenow.com) to obtain a Rome PDI.
(/dev.do#!/guide/rome/now-platform/pdi-guide/personal-developer-instance-
https://developer.servicenow.com/print_page.do?release=rome&category=courses&identifier=app_store_learnv2_atf_rome_automated_test_f… 55/141
10/28/22, 7:33 AM Course | Automated Test Framework - ServiceNow Developers
(/dev.do#!/guides/rome/developer-program/github-guide/using-
servicenow-provided-application-repositories#authenticating-to-github)
https://developer.servicenow.com/print_page.do?release=rome&category=courses&identifier=app_store_learnv2_atf_rome_automated_test_f… 56/141
10/28/22, 7:33 AM Course | Automated Test Framework - ServiceNow Developers
https://developer.servicenow.com/print_page.do?release=rome&category=courses&identifier=app_store_learnv2_atf_rome_automated_test_f… 57/141
10/28/22, 7:33 AM Course | Automated Test Framework - ServiceNow Developers
Branch: main
strongly encouraged. The value in the Branch field must exist in the
https://developer.servicenow.com/print_page.do?release=rome&category=courses&identifier=app_store_learnv2_atf_rome_automated_test_f… 58/141
10/28/22, 7:33 AM Course | Automated Test Framework - ServiceNow Developers
NOTE: If the connection fails, you may have entered the ServiceNow
repository URL in the URL field instead of the forked repository URL, or
IMPORTANT: You will not see any application files in Studio until you
https://developer.servicenow.com/print_page.do?release=rome&category=courses&identifier=app_store_learnv2_atf_rome_automated_test_f… 59/141
10/28/22, 7:33 AM Course | Automated Test Framework - ServiceNow Developers
NOTE: Before you begin this exercise, you need to have forked and imported
2. In Studio, open the Source Control menu and select the Create
Branch menu item.
https://developer.servicenow.com/print_page.do?release=rome&category=courses&identifier=app_store_learnv2_atf_rome_automated_test_f… 60/141
10/28/22, 7:33 AM Course | Automated Test Framework - ServiceNow Developers
6. To load the application files included in the tag, return to the main
ServiceNow browser tab (not Studio) and click the browser's
reload button to refresh the page.
NOTE: If branch creation fails, you may have entered the ServiceNow
repository URL in the URL field instead of the forked repository URL, or
(/dev.do#!/guide/rome/now-platform/github-guide/troubleshooting-github-issues)
Past
Today
Future
https://developer.servicenow.com/print_page.do?release=rome&category=courses&identifier=app_store_learnv2_atf_rome_automated_test_f… 61/141
10/28/22, 7:33 AM Course | Automated Test Framework - ServiceNow Developers
Preparation
1. If not still open from the last exercise, open the NeedIt application
in Studio for editing.
https://developer.servicenow.com/print_page.do?release=rome&category=courses&identifier=app_store_learnv2_atf_rome_automated_test_f… 62/141
10/28/22, 7:33 AM Course | Automated Test Framework - ServiceNow Developers
QUESTION: What does the NeedIt When needed field date past
Business Rule script do?
4. Open and examine the NeedIt When needed field date today
Business Rule to understand when the Business Rule will trigger
and what happens when it triggers.
time button ( ).
2. Set the date to yesterday or any date older than
yesterday.
https://developer.servicenow.com/print_page.do?release=rome&category=courses&identifier=app_store_learnv2_atf_rome_automated_test_f… 63/141
10/28/22, 7:33 AM Course | Automated Test Framework - ServiceNow Developers
time button ( ).
2. Set the date to today.
3. Click the Submit button. Was the record saved to the
database? Based on what you know about the NeedIt
When needed field date today Business Rule, is this the
expected behavior?
5. Set the When needed field value to a future date.
1. In the When needed field, click the Select date and
time button ( ).
2. Set the date to a date in the future but not on today.
3. Click the Submit button. Was the record saved to the
database? Based on what you know about the Business
Rules for the NeedIt table, is this the expected
behavior?
https://developer.servicenow.com/print_page.do?release=rome&category=courses&identifier=app_store_learnv2_atf_rome_automated_test_f… 64/141
10/28/22, 7:33 AM Course | Automated Test Framework - ServiceNow Developers
2. Add the Create a User test step using the Search field.
Record Insert
Record Validation
Log
https://developer.servicenow.com/print_page.do?release=rome&category=courses&identifier=app_store_learnv2_atf_rome_automated_test_f… 65/141
10/28/22, 7:33 AM Course | Automated Test Framework - ServiceNow Developers
100%;"/>
6. Click the Update button.
7. You will use and test the template in the next exercise.
Create a User
Insert a Record
Validate a Record
Log the test
In addition, each of the three tests will set a date in the When needed
field. The dates will be different in each of the tests.
Past
Today
Future
Preparation
https://developer.servicenow.com/print_page.do?release=rome&category=courses&identifier=app_store_learnv2_atf_rome_automated_test_f… 66/141
10/28/22, 7:33 AM Course | Automated Test Framework - ServiceNow Developers
The tests you create are part of the NeedIt application. Make sure
NeedIt is the current scope.
button ( ).
2. Open the Developer pane.
3. Use the Application field to verify the current application is NeedIt.
4. If you would like, set the Show application picker in header toggle
to Selected (green) to display the current application in the
ServiceNow header.
https://developer.servicenow.com/print_page.do?release=rome&category=courses&identifier=app_store_learnv2_atf_rome_automated_test_f… 67/141
10/28/22, 7:33 AM Course | Automated Test Framework - ServiceNow Developers
1. In the Test Steps related list, click the Add Test Template
button.
2. Select and configure the test template.
Template: Business Rule Test - NeedIt
Table: NeedIt
3. Click the Add button.
1. In the Test Steps related list, click the Create a User link.
2. Configure the test step variables.
First name: Jodie
Last name: Whittaker
Roles: admin
Impersonate this user: Selected (checked)
3. Click the Update button.
1. In the Test Steps related list, click the Record Insert link.
https://developer.servicenow.com/print_page.do?release=rome&category=courses&identifier=app_store_learnv2_atf_rome_automated_test_f… 68/141
10/28/22, 7:33 AM Course | Automated Test Framework - ServiceNow Developers
https://developer.servicenow.com/print_page.do?release=rome&category=courses&identifier=app_store_learnv2_atf_rome_automated_test_f… 69/141
10/28/22, 7:33 AM Course | Automated Test Framework - ServiceNow Developers
QUESTION: Why did you set a value for the When needed,
Requested for, and Requested for email fields and not for the
Request type and What needed fields?
https://developer.servicenow.com/print_page.do?release=rome&category=courses&identifier=app_store_learnv2_atf_rome_automated_test_f… 70/141
10/28/22, 7:33 AM Course | Automated Test Framework - ServiceNow Developers
2. Click the Data Pill Picker ( ) button for the Record field.
3. Click Step 2: Record Insert.
4. Click Record.
5. Configure the field values to validate.
[Requested for] [is] [(Step 1: Create a User ➔ User)]
[Requested for email] [is] [(Step 1: Create a User ➔
User ➔ First name).(Step 1: Create a User ➔ User ➔
Last name)@example.com]
[Request type] [is] [Legal]
[What needed] [is] [Legal 1]
[When needed] [is not empty]
100%;"/>
6. Click the Update button.
https://developer.servicenow.com/print_page.do?release=rome&category=courses&identifier=app_store_learnv2_atf_rome_automated_test_f… 71/141
10/28/22, 7:33 AM Course | Automated Test Framework - ServiceNow Developers
2. In the Log field, enter the text Test of When needed with a
date in the future should succeed. Record inserted by
test: (include a space after the colon).
3. Click the Data Pill Picker ( ) button for the Log field and
select (Step 2: Record Insert ➔ Record).
Testing
QUESTION: Why does this test not prompt you to select a Client
Test Runner?
ANSWER: All test steps in this test are server based and do not
require a Client Test Runner.
2. Examine the Run Test dialog. The test should have passed.
https://developer.servicenow.com/print_page.do?release=rome&category=courses&identifier=app_store_learnv2_atf_rome_automated_test_f… 72/141
10/28/22, 7:33 AM Course | Automated Test Framework - ServiceNow Developers
4. Examine the Step Results related list. All test steps should have a
status of Success.
https://developer.servicenow.com/print_page.do?release=rome&category=courses&identifier=app_store_learnv2_atf_rome_automated_test_f… 73/141
10/28/22, 7:33 AM Course | Automated Test Framework - ServiceNow Developers
3. In the Test Steps related list, click the Record Insert test step to
open it for editing.
https://developer.servicenow.com/print_page.do?release=rome&category=courses&identifier=app_store_learnv2_atf_rome_automated_test_f… 74/141
10/28/22, 7:33 AM Course | Automated Test Framework - ServiceNow Developers
DEVELOPER TIP: You may find the Copy Test button on the When needed -
QUESTION: Based on the testing you did in the last exercise, will the
user be able to save a NeedIt record with a When needed date in the
past?
Using the When needed - Future test as an example, create two more
tests:
https://developer.servicenow.com/print_page.do?release=rome&category=courses&identifier=app_store_learnv2_atf_rome_automated_test_f… 75/141
10/28/22, 7:33 AM Course | Automated Test Framework - ServiceNow Developers
After creating the two tests, run them to make sure you get the
expected results. Both tests should fail.
QUESTION: Why are the When needed - Past and When needed -
Today tests expected to fail?
ANSWER: The Business Rule NeedIt When needed field date verifies
that the When needed date is in the future. If the When needed date is
not in the future, the Business Rule prevents the record insert. The
When needed - Past and When needed - Today tests should fail to
insert the record when the Business Rule is working. The Record
Insert test step fails.
Use the Assert type field to specify the success criteria for a test step.
For example, the Assert type choices for the Record Insert test step
are:
https://developer.servicenow.com/print_page.do?release=rome&category=courses&identifier=app_store_learnv2_atf_rome_automated_test_f… 76/141
10/28/22, 7:33 AM Course | Automated Test Framework - ServiceNow Developers
Different test steps have different Assert type field values. The Record
Query test step has different Assert type values than the Record Insert
test step.
There is at least one record matching the query: The test step
is successful if the query returns one or more records.
No records match the query: The test step is successful if the
query does not find any matching records.
https://developer.servicenow.com/print_page.do?release=rome&category=courses&identifier=app_store_learnv2_atf_rome_automated_test_f… 77/141
10/28/22, 7:33 AM Course | Automated Test Framework - ServiceNow Developers
DEVELOPER TIP: Set the Assert type to match the expected outcome for the
test step so tests succeed when they match the expected outcome.
https://developer.servicenow.com/print_page.do?release=rome&category=courses&identifier=app_store_learnv2_atf_rome_automated_test_f… 78/141
10/28/22, 7:33 AM Course | Automated Test Framework - ServiceNow Developers
QUESTION: Why did you delete the Record Validation and Log test
steps?
Challenge
Update the When needed - Today test to succeed if the recorded is
created:
Test Suites
https://developer.servicenow.com/print_page.do?release=rome&category=courses&identifier=app_store_learnv2_atf_rome_automated_test_f… 79/141
10/28/22, 7:33 AM Course | Automated Test Framework - ServiceNow Developers
A test suite that runs the three tests created in the last exercise might
have a hierarchy like this:
In this example, the test suite NeedIt App Test Suite is a hierarchy of
tests and test suites.
https://developer.servicenow.com/print_page.do?release=rome&category=courses&identifier=app_store_learnv2_atf_rome_automated_test_f… 80/141
10/28/22, 7:33 AM Course | Automated Test Framework - ServiceNow Developers
The top-most level is NeedIt App Test Suite. The remaining tests and
test suites in the hierarchy are descendants of the NeedIt App Test
Suite.
Test suites can be both a parent and a child. The test suite Email
address syntax validate is:
https://developer.servicenow.com/print_page.do?release=rome&category=courses&identifier=app_store_learnv2_atf_rome_automated_test_f… 81/141
10/28/22, 7:33 AM Course | Automated Test Framework - ServiceNow Developers
Adding Tests
In the Test Suite Tests related list, use the New button to create a new
test for the test suite. To add an existing test to the suite, double-click
Insert a new row... and enter the name of a test. Select the test from
the list, then click the Save (Enter) button.
The Execution order field determines the order in which the tests
execute. ATF automatically determines the execution order based on
the order in which the tests are added. Developers can modify the
value in the Execution order field to re-order the test execution.
The Abort on failure field indicates whether to stop test suite execution
if a test fails. The default value is false. False means to continue
testing the rest of the suite even if the test fails.
https://developer.servicenow.com/print_page.do?release=rome&category=courses&identifier=app_store_learnv2_atf_rome_automated_test_f… 82/141
10/28/22, 7:33 AM Course | Automated Test Framework - ServiceNow Developers
To add an existing test suite as a child, open the child test suite for
editing. Manually set the value in the Parent suite field then save the
record.
The Child Test Suites related list displays all suites with the current
suite as its parent.
https://developer.servicenow.com/print_page.do?release=rome&category=courses&identifier=app_store_learnv2_atf_rome_automated_test_f… 83/141
10/28/22, 7:33 AM Course | Automated Test Framework - ServiceNow Developers
If the test suite contains test steps that run client-side scripts, you will
be prompted to select a client test runner. After starting a new test
runner, or selecting an existing test runner, click the Run Test Suite
button.
https://developer.servicenow.com/print_page.do?release=rome&category=courses&identifier=app_store_learnv2_atf_rome_automated_test_f… 84/141
10/28/22, 7:33 AM Course | Automated Test Framework - ServiceNow Developers
When the test suite execution is complete, view the results in the Run
Test Suite dialog window. The test results shown in the Run Test Suite
dialog follow the test suite hierarchy.
Click the Go to Result button to view the test suite results records.
Results are grouped by Test Result and by Child Test Suite Results.
On the Child Test Suite Results related list, click the Display
https://developer.servicenow.com/print_page.do?release=rome&category=courses&identifier=app_store_learnv2_atf_rome_automated_test_f… 85/141
10/28/22, 7:33 AM Course | Automated Test Framework - ServiceNow Developers
Click the Preview icon ( ) for a test to see the test step results.
DEVELOPER TIP: If tests are running slowly in the client test runner, check
(https://community.servicenow.com/community?
https://developer.servicenow.com/print_page.do?release=rome&category=courses&identifier=app_store_learnv2_atf_rome_automated_test_f… 86/141
10/28/22, 7:33 AM Course | Automated Test Framework - ServiceNow Developers
ServiceNow community.
ATF creates a new suite result hierarchy for the re-run tests. The
progress workers, test result, and test suite result records show the
same suite hierarchy as the previous test suite. They do not include
the tests or suites that passed in a previous run.
https://developer.servicenow.com/print_page.do?release=rome&category=courses&identifier=app_store_learnv2_atf_rome_automated_test_f… 87/141
10/28/22, 7:33 AM Course | Automated Test Framework - ServiceNow Developers
If a child suite or test is added to a suite with a failed test, when the
suite is re-run, ATF does not execute the added suite or test in the re-
run.
https://developer.servicenow.com/print_page.do?release=rome&category=courses&identifier=app_store_learnv2_atf_rome_automated_test_f… 88/141
10/28/22, 7:33 AM Course | Automated Test Framework - ServiceNow Developers
https://developer.servicenow.com/print_page.do?release=rome&category=courses&identifier=app_store_learnv2_atf_rome_automated_test_f… 89/141
10/28/22, 7:33 AM Course | Automated Test Framework - ServiceNow Developers
1. In the NeedIt App test suite record, click the Run Test Suite
button.
2. Examine the Run Test Suite dialog. The NeedIt App suite should
succeed.
https://developer.servicenow.com/print_page.do?release=rome&category=courses&identifier=app_store_learnv2_atf_rome_automated_test_f… 90/141
10/28/22, 7:33 AM Course | Automated Test Framework - ServiceNow Developers
3. In the Run Test Suite dialog, click the Expand button ( ) for the
When needed Field NeedIt App suite to see the test results. You
may have to scroll to see all the tests.
5. Explore the Test Results, Child Test Suite Results, and All Test
Suite Results to see what information they contain.
https://developer.servicenow.com/print_page.do?release=rome&category=courses&identifier=app_store_learnv2_atf_rome_automated_test_f… 91/141
10/28/22, 7:33 AM Course | Automated Test Framework - ServiceNow Developers
https://developer.servicenow.com/print_page.do?release=rome&category=courses&identifier=app_store_learnv2_atf_rome_automated_test_f… 92/141
10/28/22, 7:33 AM Course | Automated Test Framework - ServiceNow Developers
Create a Test
https://developer.servicenow.com/print_page.do?release=rome&category=courses&identifier=app_store_learnv2_atf_rome_automated_test_f… 93/141
10/28/22, 7:33 AM Course | Automated Test Framework - ServiceNow Developers
1. In the Test Steps related list, click the Add Test Step button.
2. In the Add Test Step dialog, select the Server category and
then select the Impersonate test step.
3. Click the Next button.
4. Configure the Impersonate test step.
User: Fred Luddy
5. Click the Submit button.
1. In the Test Steps related list, click the Add Test Step button.
2. In the Add Test Step dialog, select the Application
Navigator category and then select the Navigate to Module
https://developer.servicenow.com/print_page.do?release=rome&category=courses&identifier=app_store_learnv2_atf_rome_automated_test_f… 94/141
10/28/22, 7:33 AM Course | Automated Test Framework - ServiceNow Developers
test step.
3. Click the Next button.
4. Configure the Navigate to Module test step.
ANSWER: The Navigate to Module test step verifies the test user
can access the selected module. In this exercise, the test step is
used to open the Create New module for the NeedIt application,
which opens the same form as the Open a New Form test step,
but with the additional module verification.
1. In the Test Steps related list click the Add Test Step button.
https://developer.servicenow.com/print_page.do?release=rome&category=courses&identifier=app_store_learnv2_atf_rome_automated_test_f… 95/141
10/28/22, 7:33 AM Course | Automated Test Framework - ServiceNow Developers
2. In the Add Test Step dialog, select the Form category and
then select the Field Values Validation test step.
3. Click the Next button.
4. Configure a Condition for the Field Values Validation test
step. Hint: Use the Data Pill Picker button ( ) to use the
Impersonate test step output variable as input for the
Conditions.
[Requested for] [is] [(Step 1: Impersonate ➔ User)]
5. Click the AND button, then Configure a second Condition for
the Field Values Validation test step.
[Requested for email] [is] [(Step 1: Impersonate ➔
User ➔ Email)]
https://developer.servicenow.com/print_page.do?release=rome&category=courses&identifier=app_store_learnv2_atf_rome_automated_test_f… 96/141
10/28/22, 7:33 AM Course | Automated Test Framework - ServiceNow Developers
3. Add the NeedIt Set Requested for and Email test to the NeedIt
App suite.
1. In the Test Suite Tests related list, double-click on Insert a
new row....
2. In the search field, type NeedIt then select the NeedIt Set
Requested for and Email test from the list.
https://developer.servicenow.com/print_page.do?release=rome&category=courses&identifier=app_store_learnv2_atf_rome_automated_test_f… 97/141
10/28/22, 7:33 AM Course | Automated Test Framework - ServiceNow Developers
needed Field NeedIt App child suite is also directly connected to the
NeedIt App suite.
1. In the NeedIt App test suite record, click the Run Test Suite
button.
4. Watch the suite's tests run in the Client Test Runner. The tests
may happen quickly but try to notice:
5. When the testing is done, return to the window you used to run
the test suite.
6. Examine the Run Test Suite dialog. The NeedIt Requested for
and Email test should have succeeded.
https://developer.servicenow.com/print_page.do?release=rome&category=courses&identifier=app_store_learnv2_atf_rome_automated_test_f… 98/141
10/28/22, 7:33 AM Course | Automated Test Framework - ServiceNow Developers
8. Explore the Test Results, Child Test Suite Results, and All Test
Suite Results to see what information they contain.
Parameterized Tests
Parameterized tests run multiple times with different test data for each
run.
Parameterized testing:
https://developer.servicenow.com/print_page.do?release=rome&category=courses&identifier=app_store_learnv2_atf_rome_automated_test_f… 99/141
10/28/22, 7:33 AM Course | Automated Test Framework - ServiceNow Developers
Click the Additional actions menu ( ) and select the Save menu
item before configuring parameterization.
Creating Parameters
Parameters are variables developers can use in test steps to pass
values from a data set to the test step. Parameters can be shared or
exclusive.
https://developer.servicenow.com/print_page.do?release=rome&category=courses&identifier=app_store_learnv2_atf_rome_automated_test… 100/141
10/28/22, 7:33 AM Course | Automated Test Framework - ServiceNow Developers
Click the Switch to Global if you would like to add new Shared
Parameters link in the annotation or use the application picker to
switch to the Global application scope.
https://developer.servicenow.com/print_page.do?release=rome&category=courses&identifier=app_store_learnv2_atf_rome_automated_test… 101/141
10/28/22, 7:33 AM Course | Automated Test Framework - ServiceNow Developers
https://developer.servicenow.com/print_page.do?release=rome&category=courses&identifier=app_store_learnv2_atf_rome_automated_test… 102/141
10/28/22, 7:33 AM Course | Automated Test Framework - ServiceNow Developers
Use the New button to create a data set record or the Import button to
create multiple data set records at once.
https://developer.servicenow.com/print_page.do?release=rome&category=courses&identifier=app_store_learnv2_atf_rome_automated_test… 103/141
10/28/22, 7:33 AM Course | Automated Test Framework - ServiceNow Developers
In the Test Run Data Sets related list, click the New button. In the New
Parameter Value Set dialog, configure the values for all the
parameters used in the test. All shared and exclusive parameters can
be configured in the parameter value set.
Repeat the process for each parameter value set in the data set.
https://developer.servicenow.com/print_page.do?release=rome&category=courses&identifier=app_store_learnv2_atf_rome_automated_test… 104/141
10/28/22, 7:33 AM Course | Automated Test Framework - ServiceNow Developers
In the Test Run Data Sets related list, click the Import button. In the
Import Test Run Data Sets dialog, configure the settings for the import.
https://developer.servicenow.com/print_page.do?release=rome&category=courses&identifier=app_store_learnv2_atf_rome_automated_test… 105/141
10/28/22, 7:33 AM Course | Automated Test Framework - ServiceNow Developers
The Data Pill Picker button opens a list of steps with parameters
available for use with input variables. Output variables from previous
test steps may also be available in the list. Click Parameters to open a
list of parameters available to the test.
https://developer.servicenow.com/print_page.do?release=rome&category=courses&identifier=app_store_learnv2_atf_rome_automated_test… 106/141
10/28/22, 7:33 AM Course | Automated Test Framework - ServiceNow Developers
Create Parameters
https://developer.servicenow.com/print_page.do?release=rome&category=courses&identifier=app_store_learnv2_atf_rome_automated_test… 107/141
10/28/22, 7:33 AM Course | Automated Test Framework - ServiceNow Developers
The Create a User step needs a First name, Last name, and Roles to
apply to the new user. In this section of the exercise, you will create a
parameter for each of these fields.
https://developer.servicenow.com/print_page.do?release=rome&category=courses&identifier=app_store_learnv2_atf_rome_automated_test… 108/141
10/28/22, 7:33 AM Course | Automated Test Framework - ServiceNow Developers
1. In the Test Run Data Sets related list, click the New button.
2. Configure the new parameter value set.
First name: NeedIt
Last name: User
Role: x_58872_needit.needit_user
3. Click the Submit button.
4. Create a second parameter value set.
First name: NeedIt
https://developer.servicenow.com/print_page.do?release=rome&category=courses&identifier=app_store_learnv2_atf_rome_automated_test… 109/141
10/28/22, 7:33 AM Course | Automated Test Framework - ServiceNow Developers
2. In the Test Steps related list, click the Add Test Step button.
3. In the Add Test Step dialog, select the Server category and then
select the Create a User test step.
https://developer.servicenow.com/print_page.do?release=rome&category=courses&identifier=app_store_learnv2_atf_rome_automated_test_… 110/141
10/28/22, 7:33 AM Course | Automated Test Framework - ServiceNow Developers
https://developer.servicenow.com/print_page.do?release=rome&category=courses&identifier=app_store_learnv2_atf_rome_automated_test_… 111/141
10/28/22, 7:33 AM Course | Automated Test Framework - ServiceNow Developers
8. Add a Field State Validation test step to verify fields on the new
NeedIt form.
2. In the Add Test Step dialog, select the Form category and
then select the Field State Validation test step.
https://developer.servicenow.com/print_page.do?release=rome&category=courses&identifier=app_store_learnv2_atf_rome_automated_test_… 112/141
10/28/22, 7:33 AM Course | Automated Test Framework - ServiceNow Developers
https://developer.servicenow.com/print_page.do?release=rome&category=courses&identifier=app_store_learnv2_atf_rome_automated_test_… 113/141
10/28/22, 7:33 AM Course | Automated Test Framework - ServiceNow Developers
Requested for
Requested for email
Request type
What needed
When needed
Test
Verify the test completes successfully for both users.
https://developer.servicenow.com/print_page.do?release=rome&category=courses&identifier=app_store_learnv2_atf_rome_automated_test_… 114/141
10/28/22, 7:33 AM Course | Automated Test Framework - ServiceNow Developers
4. Watch the Client Test Runner as the test steps execute. When the
test steps finish and the Client Test Runner says Waiting for a test
to run, return to the browser tab where the Create NeedIt Module
test is open.
5. Examine the Run Test dialog. The tests should have succeeded.
6. Click the Go to Result button.
7. Examine the Test Results related list. Note that each record in the
list is the test run with a different value set.
Challenge
Add the parameterized test to the NeedIt App test suite. Test the test
suite to verify all tests complete successfully.
CHALLENGE SOLUTION:
To add the test to the NeedIt App test suite, open the NeedIt App test
suite. Add the Create NeedIt Module test to the Test Suite Tests
related list.
If you build more tests to verify access, you may want to group access
tests together in a suite.
https://developer.servicenow.com/print_page.do?release=rome&category=courses&identifier=app_store_learnv2_atf_rome_automated_test_… 115/141
10/28/22, 7:33 AM Course | Automated Test Framework - ServiceNow Developers
Scheduling
ATF developers can schedule test suites to run at a specific date and
time. Designated users are notified when scheduled test suites finish
execution.
1. Create a schedule.
1. Set frequency.
2. Set time.
2. Assign tests suites to the schedule.
1. Add users to the watch list.
2. If the test suite contains client-side tests:
1. Select a client test runner browser and browser version.
2. Select a client test runner OS and OS version.
3. If the scheduled test suites include client test steps, create
scheduled client test runners.
Create a Schedule
To create a schedule, open Automated Test Framework (ATF) >
Schedules and click the New button.
https://developer.servicenow.com/print_page.do?release=rome&category=courses&identifier=app_store_learnv2_atf_rome_automated_test_… 116/141
10/28/22, 7:33 AM Course | Automated Test Framework - ServiceNow Developers
Condition Script
Condition scripts are optional in ATF schedules. Condition scripts are
evaluated when the scheduled time is met. The last line of a
condition script must evaluate to either true or false (Not return
true or false...evaluate to true or false). If the condition script evaluates
to false, the test suites in the schedule will not run. In the example
https://developer.servicenow.com/print_page.do?release=rome&category=courses&identifier=app_store_learnv2_atf_rome_automated_test_… 117/141
10/28/22, 7:33 AM Course | Automated Test Framework - ServiceNow Developers
script, the ATF schedule is a Daily schedule set to run at 7:00 PM. The
condition script prevents the test suites from running on weekend days
even though the schedule is a Daily schedule.
DEVELOPER TIP: Condition scripts are not evaluated when testing schedules
https://developer.servicenow.com/print_page.do?release=rome&category=courses&identifier=app_store_learnv2_atf_rome_automated_test_… 118/141
10/28/22, 7:33 AM Course | Automated Test Framework - ServiceNow Developers
https://developer.servicenow.com/print_page.do?release=rome&category=courses&identifier=app_store_learnv2_atf_rome_automated_test_… 119/141
10/28/22, 7:33 AM Course | Automated Test Framework - ServiceNow Developers
DEVELOPER TIP: A test suite can appear more than once in a schedule to
versions/OSs/OS versions.
https://developer.servicenow.com/print_page.do?release=rome&category=courses&identifier=app_store_learnv2_atf_rome_automated_test… 120/141
10/28/22, 7:33 AM Course | Automated Test Framework - ServiceNow Developers
ATF administrators can view the running scheduled test runners using
the Automated Test Framework (ATF) > Run > Active Scheduled
Test Runners module.
https://developer.servicenow.com/print_page.do?release=rome&category=courses&identifier=app_store_learnv2_atf_rome_automated_test… 121/141
10/28/22, 7:33 AM Course | Automated Test Framework - ServiceNow Developers
When scheduled test suites run, users and email addresses on the
Scheduled Suite Run record's Watch list receive the Test Suite Results
report by email.
https://developer.servicenow.com/print_page.do?release=rome&category=courses&identifier=app_store_learnv2_atf_rome_automated_test… 122/141
10/28/22, 7:33 AM Course | Automated Test Framework - ServiceNow Developers
Watch List
To edit the watch list, click the Unlock Watch list ( ) button.
Preparation
https://developer.servicenow.com/print_page.do?release=rome&category=courses&identifier=app_store_learnv2_atf_rome_automated_test… 123/141
10/28/22, 7:33 AM Course | Automated Test Framework - ServiceNow Developers
Include a test that fails in the suite to see how failed tests appear in
the results.
https://developer.servicenow.com/print_page.do?release=rome&category=courses&identifier=app_store_learnv2_atf_rome_automated_test… 124/141
10/28/22, 7:33 AM Course | Automated Test Framework - ServiceNow Developers
https://developer.servicenow.com/print_page.do?release=rome&category=courses&identifier=app_store_learnv2_atf_rome_automated_test… 125/141
10/28/22, 7:33 AM Course | Automated Test Framework - ServiceNow Developers
Instances (PDIs). View sent email messages in System Logs > Emails
instead of in your email application. Open an email record and click the
https://developer.servicenow.com/print_page.do?release=rome&category=courses&identifier=app_store_learnv2_atf_rome_automated_test… 126/141
10/28/22, 7:33 AM Course | Automated Test Framework - ServiceNow Developers
1. In your email application, open the Test Suite Results for NeedIt
App email that was sent by the schedule. You may have to wait a
minute or two for the email to arrive. If the email does not arrive,
check your spam folder.
2. Explore the email to see what it contains. Click any of the links
you would like to investigate.
QUESTION: Why is the NeedIt Fail Test the only result included in the
email?
1. If not still open, open the NeedIt App Suites schedule for editing.
https://developer.servicenow.com/print_page.do?release=rome&category=courses&identifier=app_store_learnv2_atf_rome_automated_test… 127/141
10/28/22, 7:33 AM Course | Automated Test Framework - ServiceNow Developers
https://developer.servicenow.com/print_page.do?release=rome&category=courses&identifier=app_store_learnv2_atf_rome_automated_test… 128/141
10/28/22, 7:33 AM Course | Automated Test Framework - ServiceNow Developers
10. When the schedule finishes, examine the email to make sure the
schedule results are what you expected.
11. Return to the browser where you have been doing your
development work and use the Application Navigator to open
Automated Test Framework (ATF) > Run > Active Scheduled
Test Runners.
12. Open the record for the scheduled client test runner on the
second browser.
13. Click the Delete button to terminate the scheduled client test
runner on the second browser.
14. When prompted to confirm the record deletion, click the Delete
button.
15. Return to the second browser and notice the scheduled client test
runner has the status of Disconnected. Close the browser tab.
https://developer.servicenow.com/print_page.do?release=rome&category=courses&identifier=app_store_learnv2_atf_rome_automated_test… 129/141
10/28/22, 7:33 AM Course | Automated Test Framework - ServiceNow Developers
16. If you have any other scheduled client test runners running,
delete them as well.
1. If not still open, open the NeedIt App Suites schedule for editing.
https://developer.servicenow.com/print_page.do?release=rome&category=courses&identifier=app_store_learnv2_atf_rome_automated_test… 130/141
10/28/22, 7:33 AM Course | Automated Test Framework - ServiceNow Developers
In this exercise, you will save the work completed in this module to
your GitHub repository.
on how ServiceNow uses GitHub with the Developer Program learning content
Commit Changes
https://developer.servicenow.com/print_page.do?release=rome&category=courses&identifier=app_store_learnv2_atf_rome_automated_test… 131/141
10/28/22, 7:33 AM Course | Automated Test Framework - ServiceNow Developers
https://developer.servicenow.com/print_page.do?release=rome&category=courses&identifier=app_store_learnv2_atf_rome_automated_test… 132/141
10/28/22, 7:33 AM Course | Automated Test Framework - ServiceNow Developers
NOTE: If the commit change fails, you may have entered the
(/dev.do#!/guide/rome/now-platform/github-guide/troubleshooting-github-issues)
https://developer.servicenow.com/print_page.do?release=rome&category=courses&identifier=app_store_learnv2_atf_rome_automated_test… 133/141
10/28/22, 7:33 AM Course | Automated Test Framework - ServiceNow Developers
QUESTION: How do you run a test as a different user? More than one
response may be correct.
https://developer.servicenow.com/print_page.do?release=rome&category=courses&identifier=app_store_learnv2_atf_rome_automated_test… 134/141
10/28/22, 7:33 AM Course | Automated Test Framework - ServiceNow Developers
ANSWER: The correct responses are 1 and 5. The Create a User and
Impersonate test steps allow you to impersonate a different user for
the test. For the Create a User test step, be sure to configure the step
to Impersonate this user. The Create and Impersonate User test step
does not exist. A user may not have permissions to run ATF tests, so
impersonating a user or logging in as a user before running the test
would not work.
Test steps do not have an Order field. No interface allows test steps to
be reordered by dragging. Test steps can be reordered after creation.
https://developer.servicenow.com/print_page.do?release=rome&category=courses&identifier=app_store_learnv2_atf_rome_automated_test… 135/141
10/28/22, 7:33 AM Course | Automated Test Framework - ServiceNow Developers
QUESTION: How do you use data from one step in a test in a later
step?
1. Write a script to open the test step object to get the data to use in
the later step.
2. Click the step in the Data Panel and select the data to use in the
later step.
3. Create variables on the test and write scripts to populate the
variables when the test executes.
4. Click the Reference button and select the record from the table.
5. Click the Data Pill Picker button and select the variable from the
data pill picker.
https://developer.servicenow.com/print_page.do?release=rome&category=courses&identifier=app_store_learnv2_atf_rome_automated_test… 136/141
10/28/22, 7:33 AM Course | Automated Test Framework - ServiceNow Developers
ANSWER: The correct response is 1. The full name for a test runner is
client test runner. Test runners execute the client-side test steps
included in a test. While test runners can be launched in specific
browsers, the main purpose is to run the client-side test steps.
https://developer.servicenow.com/print_page.do?release=rome&category=courses&identifier=app_store_learnv2_atf_rome_automated_test… 137/141
10/28/22, 7:33 AM Course | Automated Test Framework - ServiceNow Developers
QUESTION: How can a developer re-run only failed tests when a test
suite runs? More than one response may be correct.
1. Fix the issue and click the Re-run Failed Tests button in the Test
Suite Result record.
2. Fix the issue and run the test suite again.
3. Fix the issue, open the failed tests from the Test Suite Result
record, and click the Re-run Test button.
4. Fix the issue and click the Re-run Failed Tests button in the Run
Test Suite dialog.
5. Schedule the suite to run at a better time when all tests will
succeed.
Fixing the issue and running the test suite again runs all the tests, not
just the failed tests. Tests cannot be re-run from the individual test
results under the Test Suite Result.
QUESTION: How can a developer create test run data sets for
parameterized tests? More than one response may be correct.
1. Link to a table and run the test for every record in a table.
2. Manually create parameter value sets.
3. Import a spreadsheet with the data.
4. Write a REST web service call to a data source.
5. Write a JavaScript to generate random data.
https://developer.servicenow.com/print_page.do?release=rome&category=courses&identifier=app_store_learnv2_atf_rome_automated_test… 138/141
10/28/22, 7:33 AM Course | Automated Test Framework - ServiceNow Developers
https://developer.servicenow.com/print_page.do?release=rome&category=courses&identifier=app_store_learnv2_atf_rome_automated_test… 139/141
10/28/22, 7:33 AM Course | Automated Test Framework - ServiceNow Developers
https://developer.servicenow.com/print_page.do?release=rome&category=courses&identifier=app_store_learnv2_atf_rome_automated_test… 140/141
10/28/22, 7:33 AM Course | Automated Test Framework - ServiceNow Developers
https://developer.servicenow.com/print_page.do?release=rome&category=courses&identifier=app_store_learnv2_atf_rome_automated_test… 141/141