ServiceNow New York: 4 New Features in Automated Test Framework

Automated Test Framework (ATF) is one of the major tools widely leveraged by users in their instances. This helps avoid manual testing while saving time and resources. ATF plays a major role while upgrading the instance from one version to the next.

As you’ve heard, ServiceNow’s New York update has been released and is available now! In this article we cover some of the new features and enhancements that have been added to ATF in New York.

1. Parallel Execution of Tests and Mutually Exclusive Tests

One of the major challenges faced in previous versions of ATF was not being able to perform tests in parallel. When one user is executing a test in the instance, others cannot run the same test at the same time. Instead, it gets added to the queue and once the first test completes the second starts. This used to consume significant time and resources while utilizing ATF.

Thanks to the enhancements in New York, testing time can be reduced by running multiple tests and test suites simultaneously. You can design tests to run in parallel and avoid resource conflicts and data dependencies within the instance.

You can run multiple tests, consuming up to half the available system resources of the instance. These parallel testing limits ensure the non-testing tasks will not be affected and always have resources available. Tests can be rescheduled to run later by adding them to the test queue when the system reaches the parallel testing limit.

While parallel testing, if both the tests are running on the same record, the system will automatically build in the mutually exclusive rules to avoid conflict. If the system fails to detect any resource conflict, the developer can configure their own mutually exclusive tests in order to prevent conflicting tests running in parallel.

2. Test Step Category: Create a User

This configuration helps create a user with specified roles and groups needed for the test and once the step is completed, the user record gets rolled back into the instance.

Previously when testing a piece of functionality, you had to impersonate a user with the required groups and roles in order to start testing. Whenever there were changes made to the user roles or groups, the step would fail.

Now, by using this Create User test step, you can test the functionality without depending on the user data in the system. In the same way, you would use the data from the Impersonate step, you can also use the Created User in other steps using the data pull.

3. Test Step: Add Attachments to Existing Record

Sometimes while testing functionalities, you would have a use case where users must attach a report or file in order to submit the record or proceed further.

In the previous versions of the ATF, you couldn’t test this step and needed to write additional scripts in order to test the functionality. However, with New York, a new test step is available to directly add attachments to the form.
You can test the attachment functionality in two ways, by either using the Add Attachment step or from a server-side API call.

4. Roll back in browser sessions

The way Rollback works has been changed in New York version. The session cookies roll back all changes made during the test. When a test is completed, all changes made to the system during the test are recorded for rollback. Therefore, if you modify the instance when a test is running in the same browser session, those changes will be rolled back after the test.

It is best practice to not make any changes to the instance in the same browser session when a test is running in the instance. Running the client-side test from an incognito window is also a good practice to avoid any unintentional complications.

One of the important points to remember while using ATF in the instance is, that it should never be executed in production. You can load the test cases and test suits to production so it can be executed in lower environments post clone, but you should never execute them in production.

Have questions about ATF and upgrading to New York?

INRY is an Elite level ServiceNow partner creating EASE (Efficient, Agile, Secure Experiences) for our clients. Let our consultants help you get a quick risk assessment of upgrade, plan your upgrade strategy and provide a fixed fee estimate for an upgrade. Feel free to contact us today!