Impersonation via custom step configuration not registered in atf client test runner
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-09-2025 01:36 AM
var impUser = new GlideImpersonate();
var prevUser = impUser.impersonate(userSysId);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-10-2025 05:41 AM
I just noticed that it seems like the impersonation does not really work via code in atf. E.g. the user lacks a role to view an app. My account has that role. I added a test step to check the visibility of that app to the user i am impersonating (that does not have the role). Still the step fails and says that the app was visible in the menu, although it should not have been visible. It seems like the test is still executed with my account - this would explain, why the client test runner does not update the "currently executing as"-field. But in the session-object when i call e.g. gs.getRoles() or gs.getUserDisplayName() it correctly shows the values of the user, that i impersonated.
Has anyone experienced this or found a workaround?