cancel
Showing results for 
Search instead for 
Did you mean: 

SoapUI-How to pass Environment variable from cmdSoapUI-How to pass Environment variable from cmd

Highlighted
Occasional Contributor

SoapUI-How to pass Environment variable from cmdSoapUI-How to pass Environment variable from cmd

SoapUI-How to pass Environment variable from cmd

 

Hi Team ...I want to pass a variable while running from command prompt like the env variable or a property file..

Help me with some hacks or alternatives.

The main aim is to run my project with diff env where i kept the 3 env properties file outside.

I want to run this in only SOAPUI from jenkins.

3 REPLIES 3
Highlighted
Community Hero

Re: SoapUI-How to pass Environment variable from cmdSoapUI-How to pass Environment variable from cmd

Hey,

I'm also interested in this too. I also have environmental properties files that i currently repoint by opening soapui, checkout, import the properties (to switch environments), then check back in to apply the environmental repoint.

I don't know how else to manage this....

Cheers,

Rich
if this helped answer the post, could you please mark it as 'solved'? Also if you consider whether the title of your post is relevant? Perhaps if the post is solved, it might make sense to update the Subject header field of the post to something more descriptive? This will help people when searching for problems. Ta
Highlighted
Occasional Contributor

Re: SoapUI-How to pass Environment variable from cmdSoapUI-How to pass Environment variable from cmd

Hi @nmrao ..any idea on this?

Highlighted
Occasional Contributor

Re: SoapUI-How to pass Environment variable from cmdSoapUI-How to pass Environment variable from cmd

Hi @GAcharya 

 

If you only want to pass a variable to SoapUI using the command line (aka testrunner), you can easily use one of those option for example:

  • D : Sets system property with name=value
  • G : Sets global property with name=value
  • P : Sets project property with name=value, e.g. -Pendpoint=Value1 -PsomeOtherProperty=value2

You can find more info here: https://www.soapui.org/docs/test-automation/running-functional-tests/

Another way could be to create different "soapui-settings.xml" files including some specific global properties, and set the file to use with this option:

  • t : Sets the soapui-settings.xml file to use, required if you have custom proxy, ssl, http, etc setting

 

In case you want more, like using a properties file, I suggest using some kind of "Setup Script" to load your custom properties. But you'll have to duplicate the script into each TestSuite or TestCase depending on your usage.

 

Let me know if it can help.

New Here?
Join us and watch the welcome video:
Top Kudoed Authors