If you have followed my work as a developer advocate for ServiceNow at all, you will have noticed that I love automated testing. Even before the original release of the Automated Testing Framework, I presented on testing at Knowledge15. This is really a chunk of the platform close to my heart. This year at Knowledge18, Boris BC
Application Navigator Test Steps
One of the fundamental aspects of setting up a ServiceNow application is verifying that the application and/or modules are or are not showing in the application navigator for a given user with a given role. This is pretty tedious stuff and as we know the heuristic, the more tedious the task the more we want a robot to do it. As of London, there are test steps to assert whether menus and modules are visible.
Negative Assertions for Server Test Steps
You can now choose the Assert Type as either positive or negative when using any of the following test steps:
- Record Query
- Record Insert
- Record Update
- Record Delete
- Record Validation
- Search for a Catalog Item
This allows you to set up an automated test where the correct result is the negative of the step. For example, if you want to verify that a specific record does not exist on the system or no record of a certain criteria, you can do a Record Query with a negative test result. In this case, the test passes when the query turns up no records. Previously that would have been a failure no matter what your intention.
Introduction Service Portal
As of London, Service Portal enters the world of ATF! For Service Portal forms, you can now execute any of the following test steps:
- Open a Service Portal form
- Set field values
- Validate field values
- Validate field states
- Check UI Action visibility
- Click a UI Action
- Validate form submission
This is not yet to the world of testing all the variety of possibilities of Service Portal widgets with their many possible interaction modes, but it is a beginning of bringing Service Portal into the library of automated tests.
Whitelisted Client Errors
You can choose to handle this error by ignoring completely future occurrences of this error logging the warning. (“Add all client errors to warning list”)
You can also choose to completely ignore these errors completely. (“Add all client errors to ignored list”)
New Service Catalog Form Test Steps
There are now additional test steps available to test Service Catalog functionality. You can open and submit record producers, handle all the variable and validation steps, order and validate the items. For individual items you should be able to test an order end-to-end. At this point, you can’t assert a multiple item cart. That is still for the future, but now you should be able to carry individual catalog items through the full cart cycle with every permutation of variables.
Screenshot timeout interval setting
You can now set a timeout for screenshots in the Automated Test Framework Properties. By default this is set to 60 seconds. If after 60 seconds the screenshot cannot be taken, it is skipped. However, if for some reason you need a longer timeout based on the networking or performance characteristics of a test runner or possibly a page with a long lifecycle, you can increase this. Note that this will affect the total time it takes tests to run, but then again they are robots and are not paid by the hour (unless they are on a cloud VM and then maybe they are.)
ATF is always one of my favorite parts to explore of any new ServiceNow release. For those of similar passion as myself, I hope you get a chance to dig around inside the system and see how these new features, steps and assertions can be used to create value for your development organization.