Send your request Join Sii

Automated Test Framework (ATF) provides an environment for creating, executing, and managing automated tests directly in ServiceNow. With ATF, you can create tests that simulate user actions, interactions with forms, workflow processes, and other elements of the ServiceNow platform. This allows for verifying the correctness of application functionality and processes and facilitating the detection of errors or changes that may impact system operations. For example, after upgrading the ServiceNow version, during application development, or while implementing various configurations for an existing instance using “update sets”.

ATF offers features such as:

  • defining test data,
  • assertions and test logic,
  • generating reports,
  • tracking test results,
  • capturing screenshots for individual test steps,
  • and much more.

This tool enables centralized test management and integration with other functionalities of the ServiceNow platform.

The Automated Test Framework aims to streamline the ServiceNow platform’s application and process testing process, increasing efficiency and the quality of deployed solutions.

Benefits of using the Automated Test Framework

By leveraging ATF, organizations can achieve the following benefits:

  1. Reduced testing time – ATF allows for test automation, reducing the time required for manual testing. This enables faster verification of application functionality.
  2. Increased efficiency – test automation using ATF enables faster and more precise test execution, enhancing the efficiency of the testing process.
  3. Improved software quality – automated tests facilitate thorough examination of multiple aspects of an application, leading to the detection of errors and shortcomings and enhancing software quality.
  4. Resource savings – automated tests using ATF help save human and time resources that can be redirected to other important tasks.
  5. Easy test replication – ATF enables the creation of tests that can be easily replicated and executed in different contexts, facilitating application testing across various scenarios.
  6. Scalability – with ATF, tests can be created as sets that can be run in batches, allowing for scalable testing processes, particularly for large and complex applications.

Examples of Automated Test Framework Applications

Creating a test suite based on Quick Start Suites

This tool enables the quick creation of both individual tests and test suites as they are prepared in a way that allows for easy customization to meet current requirements without the need to invest valuable time in creating them from scratch.

An undeniable advantage of Quick Start Suites is the ability to add, remove, and modify tests to fit specific use cases and business requirements. By default, test suites are included, e.g. for incidents, problems or change management.

Sample tests suites for Quick Start Tests
Fig. 1 Sample tests suites for Quick Start Tests

Creation and Management of Incidents

ATF can be used to test the incident management process. Tests can be defined to simulate the creation of new incidents, updating their status, escalating created incidents, and verifying the correctness of actions related to incident management.

Przykładowe testy do zarządzania Incydentami
Fig. 2 Sample tests for Incident Management

Change Management (also known as Change Request Management)

ATF enables testing of the change management process on the ServiceNow platform. Test scenarios can be created that encompass the creation, assessment, approval, and deployment of changes, as well as verifying the impact of these changes on the business environment.

Sample tests for Change Management
Fig. 3 Sample tests for Change Management

Problem Management

ATF can also be used to test the process of managing another type of ticket, namely Problems. Tests can be prepared to simulate the creation of new problems, updating their status, or submitting a new Change Request based on a Problem.

Sample tests for Problem Management
Fig. 4 Sample tests for Problem Management

Other features of the Automated Test Framework

ATF features include, among others:

  • Form and process testing – it allows for verification of correct form completion, ensures service handling processes are functioning as expected, and validates proper data processing and storage.
  • External integration testing – ATF enables testing of integrations with external systems or API interfaces. Tests can be created to simulate data exchange with other systems, verifying communication accuracy and information processing.
  • User interface (UI) testing – ATF facilitates automated user interface testing. This means tests can be created to verify the correct display of UI elements, responsiveness to user actions, field validation, and other aspects related to user interaction.
  • Restoring the system state to a previous configuration, known as ‘rollback’ – occurs after test execution, removing any changes made by the tests. This is particularly useful when testing applications where introduced changes may impact the functionality of other processes or data, as well as when we want to ensure that tests do not leave permanent changes in the production system.
  • “Test Step Templates” – is a feature that allows the creation of reusable templates for test steps in different tests. They simplify the test creation process by defining steps that can be easily inserted into various test suites. For example, if the same login step is used in multiple tests, we can create a Test Step Template for that step and reuse it in different test suites. This significantly saves the time and effort required to write the same steps repeatedly. “Test Step Templates” also allow customization of existing templates or the creation of new ones to match specific project requirements.
  • The ability to capture client-side screenshots of test steps executed in the user interface – allows for visual tracking of test execution and analyzing results in a more clear and intuitive manner. This enables us to see how the application appeared at specific moments, facilitating error diagnosis and understanding of the test context. It also facilitates improved test documentation, and analysis, and streamlines the debugging process.

Thanks to the flexibility and extensive capabilities of ATF, this tool can be tailored to meet individual needs and organizational requirements, speeding up the testing process and ensuring high-quality solutions on the ServiceNow platform.

Example of Test Structure in the Automated Test Framework

The Automated Test Framework offers extensive capabilities for managing test cases. It allows users to create, organize, and manage test cases, providing comprehensive test coverage. Test cases can be easily customized and parameterized, enabling test execution in different configurations and environments.

The Automated Test Framework supports the creation of multi-level hierarchies, where a test suite can serve as both a parent (Parent Test Suite) and a child (Child Test Suite). In addition, each set of tests can be performed individually and scheduled for execution at a specific time, which allows for flexible test management, enabling their scheduling depending on the needs and priorities of the project. For example, the diagram below illustrates Test Suite 1 as the top-level parent in the hierarchy. Test Suite 1.3 is a child of Test Suite 1 while also acting as a parent for Test Suite 1.3.1 and Test Suite 1.3.2.

Przykładowa hierarchia testów i zestawów testów
Fig. 5 Sample hierarchy of tests and test suites

ATF Test Generator and Cloud Runner – the ability to run tests without the need to engage the user interface

ATF Test Generator and Cloud Runner are tools that enable the generation of regression tests for a specific instance.

The Test Generator creates tests by analyzing the behaviour and processes occurring within the instance. ATF Test Generator integrates with the existing ATF framework. With this tool, tests can be executed using the ServiceNow Cloud Runner, which runs ATF tests in a browser without involving the graphical user interface (the browser is hosted by ServiceNow).

Before starting to work with the Generator, it is important to ensure that our instance is using the “ADCv2 load balancer”. More information about the “ADCv2 load balancer” can be found on the ServiceNow website. It is also advisable to verify that all the add-ons for this functionality are installed in our instance. This can be checked by navigating to “System Definition -> Plugins” as shown in the image below.

A module in which user can check the installed plugins and those that can be installed in the system we use
  Fig. 6 A module in which user can check the installed plugins and those that can be installed in the system we use

The photo below shows the already installed “plugin”:

Zainstalowany dodatek do ATF Test Generatora
Fig. 7 ATF Test Generator plugin installed

To generate tests using ATF Generator, you must first set up credentials for the Cloud Runner user. In the navigator, enter the phrase “select cloud” and select the option that is marked in the photo below:

Configuring credentials for the Cloud Runners user
Fig. 8 Configuring credentials for the Cloud Runners user

In the next step, it is required to enter a user who has the “admin” role assigned:

Entering a user with the "admin" role
Fig. 9 Entering a user with the “admin” role

To generate ready-to-run tests, enter “test gener” in the navigator and select the option marked in the picture below:

Navigating to the Test Generator
Fig. 10 Navigating to the Test Generator
Specifying the conditions for generating tests
Fig. 11 Specifying the conditions for generating tests

After generating the tests, the user will receive relevant information. To go to the tests, you need to click on the link provided as shown in the picture below:

Information about generated tests
Fig. 12 Information about generated tests
List of generated test suites
Fig. 13 List of generated test suites

As mentioned at the beginning of this chapter, the described functionality allows for test execution without the need to use the graphical user interface.

Until now, during test execution, users were somewhat “bound” to one option, and the graphical interface was launched. Furthermore, if it (the interface) was not open in the active browser window, it often resulted in exceeding the specified time for executing a particular test (known as a timeout), and the test was not performed.

The image below shows a test being executed using the graphical interface:

Uruchomiony test z wykorzystaniem interfejsu graficznego
Fig. 14 Running a test using the graphical interface

The functionality described here gives the user the option to choose whether they want to see what the running test is doing, step by step, or if they prefer it to be executed in the “cloud.” Test data is temporarily stored in the browser session, which in turn is stored in the ServiceNow data center. After all the tests have been completed, the test data is deleted.

The photo below shows the possibility to select and run a test using the “Cloud Runner”:

Ability to select "Cloud Runner"
Fig. 15 Ability to select “Cloud Runner”

After selecting “Cloud Runner”, the test starts:

Informacja o statusie „Cloud Runnera”
Fig. 16 “Cloud Runner” status information

The result of the test performed using “Cloud Runner” is shown in the picture below:

Test result with "Cloud Runner"
Fig. 17 Test result with “Cloud Runner”

Best Practices Recommended by ServiceNow for Creating and Executing ATF Tests

To make the best use of the tool’s potential:

  • Customize tests to key test scenarios – ATF is designed for functional testing of specific business processes. Focus on key user paths or processes within the ServiceNow application.
  • Perform impersonation first – typically, the first step in any test is to impersonate the appropriate user who will perform the specified task. To impersonate a user, use the test step “Create User” to create a user with specific roles and groups for testing. After the test, the record created for testing purposes (e.g., the user) will be deleted.
  • Group tests – creating and running test suites allow for grouping tests in a specific order to test applications or related functionalities. This allows for executing tests and viewing results as a single task.
  • Run tests in parallel – reduce testing time by running multiple tests and test suites in parallel. Tests that create their own data should be run in parallel to avoid data dependency conflicts. Tests can be marked as mutually exclusive to prevent the simultaneous execution of tests requiring the same data.
  • Utilize “Delay” capabilities – test steps provided by ATF come with an intelligent “delay” mechanism, meaning that the currently executed step must be completed before proceeding to the next test step. However, asynchronous server updates such as event processing, data flow updates, and email notifications may require additional waiting time for these actions to finish. Setting a timeout during test step creation can also be useful for test debugging. For example, setting a time limit (delay) of 30-60 seconds allows for viewing the created records before they are deleted.
  • Be concise – try not to test everything, focus on key elements, and create concise tests/test suites for each of them. This simplifies test creation and error analysis. ATF allows for combining multiple tests as part of a test suite and using hierarchical test suites. This allows for conducting additional tests if an early test step fails.
  • Avoid duplicating test steps – do not repeat testing the same user interface functionality in multiple tests. If other tests require similar functionality, simulate it using “server test steps.”
  • Validate updates for created records – whenever a record is updated, add a test step (Record Validation) to ensure that it has indeed been updated.
  • Test functionality, not data – instead of testing all possible data combinations, create one or two tests focusing on functionality. Then verify if the values change as expected, without wasting time testing all possible combinations.

Conclusion

The Automated Test Framework is an extremely useful tool for organizations utilizing the ServiceNow platform. With ATF, the application and process testing process can be automated, resulting in increased efficiency, better quality, and reduced risk of errors. Implementing ATF can be a crucial step in ensuring the reliability and optimal performance of a ServiceNow-based system.

Sources

5/5 ( vote: 1)
Rating:
5/5 ( vote: 1)
Author
Avatar
Michał Różycki

Software Tester with 5 years of experience. He started his adventure with ServiceNow in July 2020. Privately, a father of 3 children, who likes to read books in his free time (if it happens)

Leave a comment

Your email address will not be published. Required fields are marked *

You might also like

More articles

Don't miss out

Subscribe to our blog and receive information about the latest posts.

Get an offer

If you have any questions or would like to learn more about our offer, feel free to contact us.

Send your request Send your request

Natalia Competency Center Director

Get an offer

Join Sii

Find the job that's right for you. Check out open positions and apply.

Apply Apply

Paweł Process Owner

Join Sii

SUBMIT

Ta treść jest dostępna tylko w jednej wersji językowej.
Nastąpi przekierowanie do strony głównej.

Czy chcesz opuścić tę stronę?