The new Automated Test Framework (ATF) in the Istanbul release is a long-awaited feature that I’m sure many people are excited about. Test automation has been a focus area of mine for some time.
Automated testing will help the testers to save time and perform more accurate testing. There exist a few plugins related to automated testing in ServiceNow with many nice features and advantages. All these features come in a price. Meanwhile the ATF comes build in on ServiceNow and free of charge. After I did some research and try to put it on work, I went through some limitations. One key disadvantage is the speed. ATF is a little slow during executing tests and test suits. There is no option to rise defects and to assign them to the responsible team.
The Test Management application has been available since the Fuji release. It has test cases and suites for tracking manual test activities for ServiceNow or any other applications. First thing I noticed was ATF and Test Management are two separate applications. This means those who’ve been using Test Management for ServiceNow testing will need to keep track of testing in two separate places. The same applies to those who have a mix of manual and automated tests, which is a common scenario.

Overview

  • When you create an automated test, you create a record in the Tests table.
  • Each test record contains a related list of steps and each step defines an action for the test to execute
  • When you run a test, the framework creates a Test Results record that you can inspect to learn what happened.

BIG CONCEPT

An automated test can perform many of the same operations users normally perform manually through the web browser.

Test Steps:

atf1

Basic functionality:

  • Create and run tests
    Edit existing tests to add or delete steps
    Change the order of executes steps
    Create and run a suite of tests
    View detailed records, including screenshots
    Pass values from one step to another
    Change administration settings

Create a new test:

Role required: [atf_test_admin] or [atf_test_designer].
Navigate to Automated Test Framework > Tests.
Click New.

atf2

Test Case 1: Basic Form Operations

Step 1 – Impersonate
Step 2 – Open a new form
Step 3 – Set Fields Values
Step 4 – Submit a Form

atf3

Results:

atf4

Failure Case 1: Basic Form Operations

Step 1 – Impersonate
Step 2 – Open a new form
Step 3 – Set Fields Values (add field that doesn’t exist )
Step 4 – Submit a Form

atf5

atf6

Result:

atf7

Test Case 2: Testing a business rule

Step 1 – Impersonate
Step 2 – Open a new form
Step 3 – Set Fields Values
Step 4 – Submit a Form
Step 5 – Field Values Validation

atf8

atf9

Results:

atf10

You have the possibility to create custom steps by writing scripts like this example below:

atf11

Script to validate if the visibility of UI Action exist on a form.

Other cases: Testing data policy, script include, reference a value from a previous step, etc.

Complex Scenarios: Testing workflows, Testing Service Catalogue request, Testing UI Actions, Integrations .

atf12

LIMITATIONS:

atf13

What we can Do?

  • Experiment with different scenarios
    Don’t be afraid to test and use it
    Carefully create steps of testing
    Analyze the problem and find the right steps
    Schedule tests before we go home to run during night .
    Take a coffee and check results
Podziel się tym artykułem