- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-13-2020 06:51 PM
Hi experts!
I did an Impersonate user on ATF and performed a certain action. Then I am looking for a way to End Impersonation or pretend to be the first user to log in.
But I can't find the End Impersonation section in the ATF.
          
Is there a good way to do this?
Best regards.
senon
Solved! Go to Solution.
- Labels:
-
Automated Test Framework

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-14-2020 05:03 AM
Hi Senon,
Not sure if I'm late to the party, but there is an "End Impersonation" that I came up with. I haven't seen it elsewhere so far. See below:
1. Start your ATF Test with a 'Run Server Side Script' Step. Clear all the 'Test script' contents, and copy/paste this - "outputs.record_id=gs.getUserID();" and save. What this does is record the User ID of the person who kicked off the ATF Test.
2. Next, create and impersonate your Test User.
3. Once ready to end the impersonation, all you have to do is to impersonate the person in Step 1 by referencing. This goes back to you or whoever kicked off the ATF Test.
Let me know if this helps or if you need some screenshots. I'd be more than happy to provide.
Regards,
Gerald
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-13-2020 06:58 PM
Just initiate another impersonate back to the original user. Something like this
Step 1. Impersonate ATF Change Manager
Step 2-4. Do stuff
Step 5. Impersonate ITIL user
Step 6-8. Do more stuff
Step 9. Impersonate ATF Change Manager
And so on.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-13-2020 07:12 PM
As bryanshaw replied, there's no end impersonation in ATF nor in script. You'll just have to impersonate back to the original user. Impersonating user would also end if the test is completed.
Also, starting with New York, ServiceNow recommends Create User step instead of impersonating user because impersonating user would require the user to exist and be active. Otherwise, the test would fail. With Create user, this would not happen.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-14-2020 05:03 AM
Hi Senon,
Not sure if I'm late to the party, but there is an "End Impersonation" that I came up with. I haven't seen it elsewhere so far. See below:
1. Start your ATF Test with a 'Run Server Side Script' Step. Clear all the 'Test script' contents, and copy/paste this - "outputs.record_id=gs.getUserID();" and save. What this does is record the User ID of the person who kicked off the ATF Test.
2. Next, create and impersonate your Test User.
3. Once ready to end the impersonation, all you have to do is to impersonate the person in Step 1 by referencing. This goes back to you or whoever kicked off the ATF Test.
Let me know if this helps or if you need some screenshots. I'd be more than happy to provide.
Regards,
Gerald
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-16-2020 08:06 PM
You have presented me with the way I really wanted to do it.
It worked successfully.
Thank you so much.
senon