ATF - Impersonating the Technical Owner from a Catalog item record
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hi, I'm trying to enhance an ATF test not hard coding the impersonation of the technical owner for a Catalog Item, since this may change and make the test fail. At the moment I'm impersonating a specific user.
Basically I want to pick the technical owner field value: 'owner' from a record in the sc_cat_item table and impersonate it. I have tried several server side script steps I found in the community and other sources but nothing seems to work.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hi @luiscarrion
That’s not possible because it is ATF. We need to define which user should be used to run the test case, and we also need to inform the system which user is being impersonated.
Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/dratulgrover [ Connect for 1-1 Session]
****************************************************************************************************************
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago - last edited 3 weeks ago
Hi @luiscarrion
Refer:
KB0782883 ATF Failure: Error Impersonating the User
Regards
Tanushree Maiti
ServiceNow Technical Architect
LinkedIn: https://www.linkedin.com/in/tanushreemaiti
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hi @luiscarrion
Try following steps:
1. Submit request.
2. Record Query on sysapproval_approver table and add filter such as created today. and make sure before hand that in approval table created is selected as below.
3. Use Impersonate >>Record query.
This would solve your issue.
***********************************************************************************************************************
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
hi, thank you all for your inputs. @Shaqeel I tried your solution but I'm not able to impersonate the approver from the record query, or at least I don't see any way of pointing to the approver sys_id from the Impersonation step, using the pill it takes the approval record but not the approver (user). Thank you.