Forum Discussion

SumitM's avatar
SumitM
Occasional Contributor
7 years ago

How to pass custom properties values to SoapUI Pro from command prompt.

I need to set some custom properties (ex. endpoints, version number, etc) to Test Project custom properties before running the Test suite. I need to pass Custom Properties for Test Project through command prompt. Is there any way I can pass some custom properties through command prompt?

  • You can do that with the snippet I posted above.

     

    • -PPropertyName=value 
    • -PAutomated=true

    That will at least set a Project level Custom property to an overridden value. I am not 100% sure if that Property has to exist or if this would create it. But I do know if you have a Project level Custom property called "Automated" and it is set to false, passing in "-PAutomated=true" would override that to false when ran with the testrunner.bat command line arguments. 

  • groovyguy's avatar
    groovyguy
    Community Hero

    The documentation on this is here. Some examples from my experience are below. There's a lot of different settings and properties you can override or set via the command line runner. Hope this helps!

     

    • To override a Project level property, you can use the following.
      • -PPropertyName=value 
      • -PAutomated=true
    • To override or set a Global Property, you can use:
      • -GPropertyName=value
      • -GAutomated=true
    • SumitM's avatar
      SumitM
      Occasional Contributor

      Hi groovyguy,

       

      Thanks for the reply.

       

      Actually I am looking for way to set Project level custom properties directly. I am using the custom properties to pass values to my api's. Is there any way that I can set the custom properties directly from command prompt?

      I am refering the below custom properties : (Please find attachement)

       

      • groovyguy's avatar
        groovyguy
        Community Hero

        You can do that with the snippet I posted above.

         

        • -PPropertyName=value 
        • -PAutomated=true

        That will at least set a Project level Custom property to an overridden value. I am not 100% sure if that Property has to exist or if this would create it. But I do know if you have a Project level Custom property called "Automated" and it is set to false, passing in "-PAutomated=true" would override that to false when ran with the testrunner.bat command line arguments.