- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-11-2019 03:43 AM
I want to use the ATF to test some business rules and other customizations on the User form. One requires a test to create a user and assign a specific role. I have tried several different ways but I cannot figure out how to do this. Simply doing a "Set field values" on the the User form doesn't work. Can someone point me in the right direction?
Solved! Go to Solution.
- Labels:
-
Automated Test Framework

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-11-2019 08:31 AM
Hi Peter
You can also use 'Record Insert' step. You can insert the data into the table 'sys_user_has_role' with following values:
1. user: sysID of the user
2. role: sysID of the role
3. active: true
--
Best regards
Ankush
P.S. Please mark helpful/correct as appropriate to help fellow Community user in identifying useful answers.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-11-2019 04:32 AM
i believe the role which you are setting on user profile is a related list.
if you see the ATF there is not a direct way to set the role on user profile. you have to write script in ATF, you can use the "Run Server Side Script" test step and get the user id from the previous steps and then you can set it.
please have a look the doc link below.
Run Server Side Script test step
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-11-2019 04:36 AM
Thanks. I'll give that a try today if I get a chance.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-11-2019 05:23 AM
Wow. Those are some pretty poor examples and skimpy documentation. It looks like the thing I need but it is going to take some work to figure out how to use the "steps" function properly to refer back. Who would have thought an example like "return x+3" would be a good demonstration of function?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-11-2019 08:31 AM
Hi Peter
You can also use 'Record Insert' step. You can insert the data into the table 'sys_user_has_role' with following values:
1. user: sysID of the user
2. role: sysID of the role
3. active: true
--
Best regards
Ankush
P.S. Please mark helpful/correct as appropriate to help fellow Community user in identifying useful answers.