Forum Discussion

Siemens__s_r_o_'s avatar
Siemens__s_r_o_
Occasional Contributor
12 years ago

[Res] test is run from the commandline with groovy

Hi guys,

I'm writing a Setup Script for a Test Case that needs to execute different logic based on whether it's run from commandline or triggered in the UI. (UI interaction vs. dynamic ID generation, detail on this are not important )

Question is:
Is there some context property (or other functionality), on which I can base the decision whether the test was triggered from the Command Line or the UI?


For example, to decide if the Test Case was run as a Load Test or separately, I can use:
context.getProperty("LoadTestRunner") == null

I was unable to find this kind of functionality for commandline trigger

Thanks,

Jakub

3 Replies

  • Hi,

    You can add the following script in the set up script as IBM - PA Support mentioned,

    if (com.eviware.soapui.SoapUI.isCommandLine()){
    log.info "Execution via commandline"
    }



    Check SoapUI logs when you use testRunner.
    Also to print logs in Load test you need to enable logs for load test, so go to File > Preferences> UI Settings > Check the "Do not disable the groovy log when running load tests"

    Thanks,
    Jeshtha