- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-04-2020 06:15 AM
So, we have read where it is better to use the "Create a User" Step instead of the "Impersonate a User" step (especially to protect against the situation where a user may become inactive.
We see where you can select Groups/Roles for users when using "Create a User", but what about other "User" related-fields? We have certain Catalog Items that have Criteria that make them only available based on which Department a User is in. But we do not know how we can set the Department field when using the "Create a User" step.
Likewise, some of our Catalog Items have approvals that are based on the User's Manager, so I think we need a way to set the User's Manager when we Create a User, but do not see how we can set a Manager when we use "Create a User".
So how can we set things like "Department" and "Manager" when we use the "Create a User" step in Automated Testing Framework Tests when Testing Catalog Items (for our Service Portal)?
Thanks
Solved! Go to Solution.
- Labels:
-
Automated Test Framework

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-04-2020 01:14 PM
I'm not sure it's covered in the ATF Fundamentals course, but that is a pretty thorough 8-hour self-paced training course and a great place to start. It is also mentioned, though not with an example, in the ATF webinar and best practices links you can find at this ATF Resources post.
For your use case it would look like:
ATF Test Step 1: Use the record query step to lookup a user that meets the specifications you're looking for (has a department or manager, etc.)
ATF Test Step 2: Impersonate step where you impersonate the user found in the record query step 1.
I've been meaning to write up a detailed post on dynamic selection, but in the meantime hopefully this helps. The ATF Resources post I linked to has a couple of different training links I would definitely work through.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-04-2020 12:32 PM
It's really just an informal term we use to describe using a record lookup step to retrieve a specific record rather than hardcoding a record. For example, in your case you would use a record lookup for query the user table for a user that has the necessary values filled in for department, etc. Then in the next step you would impersonate the record found in the user step. That way you are not dependent on a specific user sys_id existing.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-04-2020 12:53 PM
OK, how exactly does one do that?
Is there an example out there I can see?
I am sure it is easy, once one knows how to do it, I am just not seeing it (I wish they had some more robust training around ATF!).

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-04-2020 01:14 PM
I'm not sure it's covered in the ATF Fundamentals course, but that is a pretty thorough 8-hour self-paced training course and a great place to start. It is also mentioned, though not with an example, in the ATF webinar and best practices links you can find at this ATF Resources post.
For your use case it would look like:
ATF Test Step 1: Use the record query step to lookup a user that meets the specifications you're looking for (has a department or manager, etc.)
ATF Test Step 2: Impersonate step where you impersonate the user found in the record query step 1.
I've been meaning to write up a detailed post on dynamic selection, but in the meantime hopefully this helps. The ATF Resources post I linked to has a couple of different training links I would definitely work through.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-05-2020 10:25 AM
Thank you!
This worked very well. i like this approach a lot! This way, we don't need to worry about setting all the correct values, we just find a person who meets the criteria.
This seems like the best approach to take for us.
Thanks to everyone else for their input too.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-04-2020 01:18 PM
Could it be because you are updating the same impersonated user (After the impersonation) ?
Will this user be able to update its own record ? Try to impersonate this user after you update the department for this user and see if it works.