ATF - Impersonating the Technical Owner from a Catalog item record

luiscarrion
Tera Contributor

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. 

2 REPLIES 2

Dr Atul G- LNG
Tera Patron

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]

****************************************************************************************************************

Tanushree Maiti
Tera Patron

Hi @luiscarrion 

 

Refer:

 

KB0782883 ATF Failure: Error Impersonating the User 

https://www.servicenow.com/community/developer-forum/dynamically-retrieving-the-approver-user-in-atf...

https://www.servicenow.com/community/developer-forum/atf-create-a-user-set-other-user-field-values/m...

 

Please Accept the solution if it assisted you with your question & Mark this response as Helpful.
Regards
Tanushree Maiti
ServiceNow Technical Architect
LinkedIn: https://www.linkedin.com/in/tanushreemaiti