Use breakpoints to debug an automated test (San Di... - ServiceNow Community
Mark Roethof
Tera Patron
Tera Patron

Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field

 

Hi there,

 

Browsing through the San Diego release notes, my eyes caught "Use breakpoints to debug an automated test". That sounds interesting for debugging a test (step)!

 

Let's have a closer look at this new feature within Automated Test Framework.


Use breakpoints to debug an automated test

"Pause a test to troubleshoot failures or unexpected behavior by adding a breakpoint for a particular test step. You can now also pause before rollback at the end of the test."

Note: Breakpoints are session specific.

Add/Remove Breakpoint

Basically the use of breakpoints to debug an automated test consists of a context menu item "Add/Remove Breakpoint" which is available on the Related List "Test Steps" on the Test form lay-out (right-mouse-click on a Test Step). After setting the Breakpoint, the Test Steps display name will also get some additional styling.

 

find_real_file.png

 

To make use of the breakpoint set, instead of using the normal "Run Test" UI Action, use the newly added "Debug Test" UI Action.

 

find_real_file.png


Pause before rollback

Notice when clicking the "Debug Test" UI Action, on the modal also a new checkbox is visible: "Pause before rollback". This allows you to review the Test or touched data for example, before any changes are automatically rollbacked. Another great addition for debugging purposes.

 

find_real_file.png

Paused at breakpoint

When a breakpoint is hit, the Test will pause for a maximum duration of 10 minutes. When ready yourself, you can proceed the Test manually. Within the Client Test Runner these options will be shown:

 

find_real_file.png

 

If you used the "Pause before rollback" checkbox, at the end of the Test again the Test will be paused for a maximum duration of 10 minutes. When ready yourself, you can proceed the "Run Test" modal, a "Continue" UI Action will be visible. 

 

find_real_file.png

---


And that's it. Hope you like it. If any questions or remarks, let me know!

 

C

If this content helped you, I would appreciate it if you hit bookmark or mark it as helpful.

 

Interested in more Articles, Blogs, Videos, Podcasts, Share projects I shared/participated in?
- Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field

 

Kind regards,


Mark Roethof

ServiceNow Technical Platform Architect @ Eraneous

3x ServiceNow Developer MVP

3x ServiceNow Community MVP

---

LinkedIn

Comments
sheryl
Tera Expert

This was very helpful - thank you!  I had seen/heard about the rollback feature in ATF for San Diego and was very happy!  When trying to figure out how to use this feature, I couldn't find documentation on docs.servicenow.com (until I found your reference in the community).  I had searched for the keywords of "rollback" and "atf rollback" and didn't find an article.... I didn't expect to see it as an additional note type of information on the break point page.   

 

If anyone from ServiceNow see's this note, it would be wonderfully helpful if features that are NEW to a release had their own section or way to filter for them.  It shouldn't be difficult to find the new functionality on a release... IMHO 🙂

If you are upgrading to San Diego (rather than a new install), you may need to check the sn_atf.debug property and set to "true" if not already set.

 

Link to the docs.servicenow.com page for atf break points, which happens to include the pause rollback feature.

Debug an automated test using breakpoints (servicenow.com)

 

Version history
Last update:
‎08-03-2024 07:11 AM
Updated by:
Contributors