Forum Discussion

sergeykh's avatar
sergeykh
Occasional Contributor
6 years ago

can I know in the project load Script if the soapUI project executed from from command line

I would like to control the flow in project load script and do something only if its executed from the command line.

Is there anything on the Project varible that I have in this context that can indicate how the project was triggered.

  • nmrao's avatar
    nmrao
    6 years ago

    sergeykh 

    I mean system arugument such as "-Dkey=value"

     

    testrunner.bas <options to execute the project> -DIS_INVOKED_COMMANDLINE=true

     

    In Load script

     

    if ('true' == System.getProperty('IS_INVOKED_COMMANDLINE')) {
    //You business logic here
    }
  • nmrao's avatar
    nmrao
    Champion Level 3
    May be you use a jvm argument passed from command line.

    In the load script, get system property value and if that matches certain condition, then execute the piece of code.
    Does it sound ok?
    • sergeykh's avatar
      sergeykh
      Occasional Contributor

      What do you mean by jvm arguments?

      I know that if I pass project level properties to be set from the command line, they are initiated after the project script is executed.

      Can you please share an example so I can test if this behaves diffrently.

      I would assume that there is some indication who is executin the project without something spesific, but seems that this is not the case.

      • nmrao's avatar
        nmrao
        Champion Level 3

        sergeykh 

        I mean system arugument such as "-Dkey=value"

         

        testrunner.bas <options to execute the project> -DIS_INVOKED_COMMANDLINE=true

         

        In Load script

         

        if ('true' == System.getProperty('IS_INVOKED_COMMANDLINE')) {
        //You business logic here
        }