Creating an ATF what group would have the role snc_internal?

snow_beginner
Mega Guru

Hello,

I am creating ATF tests to check some integrations. The first step is to create a test user. If I give the user the role snc_internal the test runs fine. However, the best practice my company is following is that a user should not be given roles, but should be given groups. I was wondering which group would have the same powers as snc_internal? Because if I remove the snc_internal role and just leave the itil role then the test fails because not everything is visible on the form to the test user. 

I tried to give the group ADMIN, but that did not work and I got an error that the user cannot be a part of this group...what should I do? I have given it the group GLOBAL Domain, but that does not have any roles in it...

Thanks

1 ACCEPTED SOLUTION

Ankur Bawiskar
Tera Patron
Tera Patron

Hi,

I don't think you should consider any such best practice while testing ATF.

Reason being ATF is just used to do automated testing and if you do this via group or direct role doesn't make any difference.

But if this was an actual requirement then yes giving role to group is recommended rather than individual users.

regards
Ankur

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

View solution in original post

4 REPLIES 4

Ankur Bawiskar
Tera Patron
Tera Patron

Hi,

I don't think you should consider any such best practice while testing ATF.

Reason being ATF is just used to do automated testing and if you do this via group or direct role doesn't make any difference.

But if this was an actual requirement then yes giving role to group is recommended rather than individual users.

regards
Ankur

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

@snow_beginner 

Hope you are doing good.

Did my reply answer your question?

If my response helped please close the thread by marking appropriate response as correct so that it benefits future readers.

Regards
Ankur

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

Community Alums
Not applicable

Hi,

You can  run the Record Query test step on the sys_group_has_role table and place the the role you're looking for in the condition as well as the group you're looking for in the other AND condition.

Get some idea from this example : https://docs.servicenow.com/bundle/sandiego-application-development/page/administer/auto-test-framew...

Also, Refer this : https://community.servicenow.com/community?id=community_question&sys_id=80b04dfddb9258d03daa1ea66896...

Mark my answer correct & Helpful, if Applicable.

Thanks,
Sandeep

dmathur09
Kilo Sage
Kilo Sage

Hi Snow,

snc_internal is an OOB role given to all the internal users of the organization. Even if you remove the role and do not give any role, snc_internal will automatically be provided. Even when a new user is created, snc_internal is provided by default. So maintaining this role with a group won't be feasible as this role is maintained by Servicenow.

Providing itil role should suffice the work, there is no requirement of providing snc_internal to the test account. Can you check what is the error received while running with just itil role.

Regards,

Deepankar Mathur