cancel
Showing results for 
Search instead for 
Did you mean: 

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

SOLVED
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.

1 ACCEPTED SOLUTION

Accepted Solutions
Community Hero

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

@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.
5 REPLIES 5
Community Hero

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

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.
Occasional Contributor

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

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.

Community Hero

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

@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.
Occasional Contributor

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

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?

 

 

Highlighted
Community Hero

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

@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.
New Here?
Join us and watch the welcome video:
SmartBear + Cucumber
Top Kudoed Authors