- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-09-2025 01:22 PM
I am trying to write an ATF test that should be simple, but has one sticking point right at the beginning.
I need to impersonate a member of a specific group. Best practices say that we should not directly impersonate an existing user, so I have two choices: create one of my own, or try to path my way into impersonating someone in the org who is a member of that group, but whose identity is not fixed.
I query sys_user_grmember to find a user in that group, which is fine.
But the record is a Group Member record, rather than a User record. There is no way to dot walk my impersonation step to the User field in the Group Member record. I have tried other, similar paths, but cannot find a way to do it. I'm sure there is scripting that could do it, but I am unclear as to what would work.
If anyone has an idea as to how this might progress, without creating a new user and assigning all roles and groups, I would appreciate it.
1. Record query on sys_user_grmember for [group name] and email > is not empty (empty emails are system integration accounts for us). Current query finds 41 group members.
2. Would like to impersonate someone from step 1. But cannot dot walk at all beyond the record ID itself; if I could get to Group Member.User, this is a simple job.
Please advise?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-10-2025 12:39 AM
Hi @Josh_ ,
Use the below script in the 'Run Server Side Script' step and in the Impersonation test step select this (Run Server Side Script test step) using data pill picker.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-10-2025 12:39 AM
Hi @Josh_ ,
Use the below script in the 'Run Server Side Script' step and in the Impersonation test step select this (Run Server Side Script test step) using data pill picker.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-10-2025 07:51 AM
This did it, thank you.
Pasting it in blew the syntax, but I got it reset and the test flows properly. I appreciate the assistance.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-11-2025 02:27 AM
Thanks!! for accepting my answer as a Solution. 🙂
Please mark the Solution as Helpful, if it really helped.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-10-2025 03:08 AM
Hi @Josh_
Have you tied create a user step and adding the group in this step only using direct method or using dot walk?
Regards
Shaqeel
***********************************************************************************************************************
If my response proves useful, please indicate its helpfulness by selecting "Accept as Solution" and " Helpful." This action benefits both the community and me.
***********************************************************************************************************************
Regards
Shaqeel