Enable dynamic multiple approval in ATF for change requests

Chenab Khanna
Tera Expert

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 

12 REPLIES 12

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

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

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

Hi Chenab,

Can you share the script here?

Regards

Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

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

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

https://docs.servicenow.com/bundle/newyork-application-development/page/administer/auto-test-framewo...

https://community.servicenow.com/community?id=community_question&sys_id=b6621f82db1da7402737e15b8a96...

Mark Correct if this solves your issue and also mark 👍 Helpful if you find my response worthy based on the impact.
Thanks
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader