- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-28-2017 07:32 AM
Hi.
I'm setting up tests in the Automated Test Framework and I ran into trouble when I stumbled upon the need to impersonate users via script.
I found somewhere else on the community that I could use
session.setUser("username");
This did not work however and resulted in an error message like "Attempted script access to inaccessible member denied." which my google-fu failed to find anything about.
Has anyone done anything like this before? Please help.
Thanks in advance.
Solved! Go to Solution.
- Labels:
-
Automated Test Framework
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-28-2017 07:39 AM
Jimmie,
I've had little luck with impersonations, however I have used gs.getSession().impersonate('xxx') within an ajax script include. Give it a try, hope it helps!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-28-2017 07:39 AM
Jimmie,
I've had little luck with impersonations, however I have used gs.getSession().impersonate('xxx') within an ajax script include. Give it a try, hope it helps!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-28-2017 07:42 AM
Hi Brandon.
Thank you for your response.
This was the correct solution.
Apparently
gs.getSession().impersonate("usernameORsysid")
takes both sysid and username as input.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-22-2018 01:25 AM
Can you provide me with complete script. This seems to give me a null string.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-28-2017 07:39 AM
Hello Jimmie
var origUser = gs.getSession().impersonate('sys_id' );