Ask a Question

fetching the logged in username using groovy

Mr_Bro
Champion Level 0

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
TNeuschwanger
Champion Level 2

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

cancel
Showing results for 
Search instead for 
Did you mean: