ATF does not work even if sn-atf-id is set for a custom UI button on Workspace
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-04-2025 07:15 PM - edited ‎08-04-2025 07:31 PM
When creating a test in ATF to click a button on the Workspace, I use the "Click Component (Custom UI)" step.
However, the button's internal ID changes each time I restart the test runner, causing ATF to be unable to identify the target component and resulting in the test failing.
While investigating this issue, I found the following official documentation:
Develop Testable Components (Yokohama)
Based on the above, I created a custom button component using npm with sn-atf-clickable and sn-atf-id (see image below).
When I select this button in ATF, the sn-atf-id is also displayed in the hover text, confirming that the attributes are set correctly.
Despite this, the "Click Component (Custom UI)" step fails when I restart the test runner.
If anyone has any ideas as to why this is happening, please let me know.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-04-2025 09:07 PM
Custom UI steps are not always reliable as it relies on HTML component for that
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-04-2025 09:16 PM
Hi @Hayato ,
Can you try this
1)
2)Have you checked UI in the Page inspector? https://www.servicenow.com/docs/bundle/zurich-application-development/page/administer/auto-test-fram...
3)If none of these working and if i need to execute this step using ATF, you may do the same action what "Click Me" button using server script.
Thank you,
Hemanth
Certified Technical Architect (CTA), ServiceNow MVP 2024, 2025
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-05-2025 01:46 AM
Hi @Hayato
Try Manual Page Inspector to identify the correct element. You are not using the right one.
Regards
Shaql
***********************************************************************************************************************
If my response proves useful, please indicate its helpfulness by selecting "Accept as Solution" and " Helpful." This action benefits both the community and me.
***********************************************************************************************************************
Regards
Shaqeel