Forum Discussion

z21ray's avatar
z21ray
Occasional Contributor
6 years ago

SoapUI on Jenkins with global variables (auth)

Hello, I have project for soapUI that contains global variables for username and password. 

 

${#Global#username}

Now I have setup to run tests on Jenkins, but it fails to authentication error. I need somehow to pass those global parameters.

I have set Jenkins job configuration, enable "This build is parameterized" and typed Name same as my variable 

username

 and value for it. But it did not work, test failed, because I see username is empty while trying to call web service.

 

2 Replies

  • groovyguy's avatar
    groovyguy
    Champion Level 1

    I assume you are using the testrunner script to run ReadyAPI via Jenkins. If so, you can use the Command line arguments to set a global property. The documentation is here: Command Line Arguments

     

    Reading that, you can use the "-G" Argument to pass in a value for a global property. Example:

     

    -GAutomated=true

    That would set a global property of "Automated" equal to true. In your case, you would want, assuming username has been set up as a jenkins parameter. 

     

    -GUsername=${username}
    • z21ray's avatar
      z21ray
      Occasional Contributor

      This exactly what I did, just did not deleted the post. It works as you said. Thanks a lot.

       

      But then next question follows - how do I hide password from logs and reports? After tests runs I see that password is printed to console and inside reports. I cannot let it be there. Help please :)