create user test step failing in ATF
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-02-2023 01:22 AM
Hi,
I have a Requirement where i need to create user and impersonate as him in ATF but when i try to run the ATF it is failing as create user test step itself
TYA

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-02-2023 01:33 AM
Hi @Mohammed Rafi S ,
Impersonation limitations
- When you impersonate any user, all scope-protected roles and encryption module roles are supported if the Impersonation option is configured in the module access policy. See Create a module access policy for details. If the impersonating user (the admin, for example) has a scope-protected role, that role is not removed from the list of roles for the user being impersonated.
- When you impersonate a user with an application-specific admin role (for example, an application admin for Human Resources or Security Incident Response), you cannot access features granted by the application admin role, including security incidents, profile information, or other scope-protected features, unless you already have those roles. Access to modules and applications in the navigation bar is also restricted. Admins cannot change the password of any user with an application admin role.
- The following actions or conditions cause a user impersonation to end:
- The user impersonates a different user
- The user session ends, for example after a user logs out of their instance
Note: The Impersonate Begin event appears in the system log (syslog.list) when impersonation begins, and the Impersonate End event appears in the system log when impersonation ends according to one of the two conditions listed above.
Impersonation requirements
The user account to be impersonated must have a user ID. You can find this ID in the User [sys_user] record for the account. If this value is missing, the message The user you selected could not be impersonated appears.
You need several different logins to test the system:
- An admin account to do work.
- An itil (or similar) login to test as a technician.
- An ess login to test as an end user.
More logins may be required to adequately test the system.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-02-2023 01:34 AM
Also,
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.
Resolution
Provide the ATF user with "admin" role. (OR) Update the ATF test step to impersonate an user without the admin role.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-02-2023 04:07 AM
@Community Alums I have admin role and tried to create ATF step to create user. the step also failed and tried to create user and checked on impersonate this step also failed

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-03-2023 12:37 PM
Did you ever resolve this? I have the same issue