ATF Test-Error during unimpersonation
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-20-2022 04:51 AM
Hi, can anyone help me with this issue?
I have a problem with unimpersonating.
I wrote the test, first step is impersonate user (when first step: create a new user and the impersonate is, i get the same message) and the test fails on the first step with the message: " Error during unimpersonation! Any further action will be done as user...:"
The user is internal! And i tried with more than one user, still the same problem.
Do you have any suggestions?
In attachmnets is screenshot.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-20-2022 05:00 AM
Hi @OMT ,
Provide the ATF user with "admin" role. (OR) Update the ATF test step to impersonate an user without the admin role.
ATF roles - "atf_test_admin, atf_test_designer, atf_ws_designer" have the impersonator role allowing users with one of those roles to impersonate other users.
The error occurs when a non-admin user (users with atleast one of the above roles), runs an ATF test which has a step to impersonate an admin user. The impersonator role does not allow impersonation of admin users.
The test will pass when an admin user runs it as an admin user can impersonate other admin users.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-20-2022 06:09 AM
Hi, @Community Alums,
i am an user with admin roles. When i impersonate an user with admin role it works. But if i impersonate an non-admin user, the Test fails and i get the same message. It is the same when i create a new user, it works just if that user admin role has, without admin role is the same problem.
In my case i have to impersonate an non admin user, because it is important for my test.
When i write the test on my servicenow personal developer instance there is no problem. I write the tests as admin and impersonate non-admin user.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-20-2022 06:12 AM
Hi @OMT ,
I assume that the impersonated user do not have the required roles to create catalog requests whereas your account it has.
Therefore, check the roles assigned to the impersonated user and in case you create that user as part of your test you have to assign the required roles as the next step after user creation.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-20-2022 06:20 AM
Hi,
Impersonated user has the required roles. The impersonated user can create Incident as well. I checked it manuell, it is possible.
Do you have any another Idea what can be the problem?