fetching the logged in username using groovy
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-03-2022
04:49 AM
11-03-2022
04:49 AM
fetching the logged in username using groovy
Hello Team,
can anyone help me how can i fetch the user profile details using groovy in soap ui,
i have to fetch the user profile name in groovy.
thanks in advance.
request you to please help me if you have already worked on such requirments.
Thanks and Regards,
Sathish Kumar K
1 REPLY 1
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-04-2022
05:36 PM
11-04-2022
05:36 PM
Hello @Mr_Bro
I don't have much, but have accessed userprofile in the past... Here is part of groovy script test step...
.
.
.
def homeProp = System.getProperty("user.home"); // log.info "homeProp: " + homeProp;
def localOS = homeProp.contains("\\"); // log.info "localOS: " + localOS;
if (localOS ) {
def env = System.getenv();
String tmpDir = '';
tmpDirStr = env['USERPROFILE'] + File.separator; // log.info "tmpDirStr: " + tmpDirStr;
}
else {
tmpDirStr = File.separator + 'tmp' + File.separator + 'edi' + File.separator; // log.info "tmpDirStr: " + tmpDirStr;
};
testRunner.testCase.testSteps["Properties"].setPropertyValue( "TempDirectory", tmpDirStr);
.
.
.
Regards,
Todd
