logo

NJP

Use breakpoints to debug an automated test (San Diego)

Import · Feb 03, 2022 · article

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.

image

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

image

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.

image

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:

image

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.

image

---

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

Kind regards,

Mar k Roethof

ServiceNow Technical Platform Architect @ Eraneous

3x ServiceNow Developer MVP

3x ServiceNow Community MVP

---

LinkedIn

image

View original source

https://www.servicenow.com/community/developer-articles/use-breakpoints-to-debug-an-automated-test-san-diego/ta-p/2323199