Ask a Question

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

SOLVED
sergeykh
Occasional Contributor

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.

5 REPLIES 5
nmrao
Community Hero

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?


Regards,
Rao.
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.

@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
}


Regards,
Rao.
sergeykh
Occasional Contributor

Thanks, this seems to work and this properties are set before the project once.

One more thing. As I`m calling extenal jar from the project load script and passing both possible variablse in this context which are project and log. Is it possible to get the system properties from the project object?

 

 

@sergeykh,

Not sure If I understand that, but you can try it and drop a note if any issues.

Appreciate if can you mark it solved the original issue mentioned in the question.



Regards,
Rao.
cancel
Showing results for 
Search instead for 
Did you mean: