Enable dynamic multiple approval in ATF for change requests

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-30-2020 10:57 PM
Hi
I have a requirement where i need to implement an automated test framework (ATF) for change request which has more than 1 approver. I have tried to build this by hard coding the users, impersonating to each approver but i need it to be dynamic so that in future if there are more approvers added or removed, my test case should still work.
Please find the attached screenshot of test steps i wrote. In that, i am impersonating to each approver in steps 10 and 15. I dont want that. Some server script which would read the approver name and impersonate it by itself.
Please let me know if there's any way we can achieve this
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-31-2020 12:14 AM
Hi Chenab,
Yes It would fail; but as you said one more approver got added so definitely the test step needs to be revised since it is a newer scenario and the current test step has been configured as per current scenario
Possibly you can think of some other approach; If I find anything will let you know
Mark ✅ Correct if this solves your issue and also mark 👍 Helpful if you find my response worthy based on the impact.
Thanks
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-31-2020 12:48 AM
Alright thanks Ankur.
In this script..as i am executing and trying to impersonate in test step using previous step output, I am getting following error -
Unable to find the user to impersonate as the user sys id is null
i used approver.sys_id as well but didnt work
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-31-2020 02:18 AM
Hi Chenab,
Can you share the script here?
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-31-2020 03:37 AM
It worked. But still trying to make the impersonation and clicking button through script so that the complete test case becomes dynamic.
Thanks for your help Ankur. Please let me know if you find anything related to dynamic approval.
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-31-2020 04:39 AM
Hi Chenab,
possibly you can store the rowcount of approval records and pass it through every atf test
in every server side step increment by 1 and you can possibly check if count is reached in every step
Mark ✅ Correct if this solves your issue and also mark 👍 Helpful if you find my response worthy based on the impact.
Thanks
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader