Forum Discussion

nkasemsan's avatar
nkasemsan
Occasional Contributor
7 years ago
Solved

testrunner.bat: syntax of command line incorrect

I am trying to run a SOAPUI opensource test suite via TeamCity. In TeamCity, there is a step that calls testrunner.bat and constructs the command line based on the parameters/parameter values I add.  The command line constructed is attached, along with the subsequent error:

 

[Step 1/1] The syntax of the command is incorrect.
[Step 1/1] Process exited with code 255

 

I have compared it to another SOAP project that runs successfully in TeamCity, and save for a few additional parameters in the other project, they look similar. In addition, I can run my test suite in SOAPUI successfully.  

 

Is there a way to troubleshoot where in my command line it is failing? Are there any restrictions that I'm not aware of using OpenSource to do this?

 

  • nkasemsan

    Not exact sure what is the issue there.

     

    Couple of suspects:

    1. The entire command should be in single line. Please check if it is in multiple lines.
    2. There are some slashes, colons etc in the property values. Wrap the value between double quotes (").

    Suggestion:

    There are so many properties that are being passed from the command line. Instead create a property file (key = value pair) and pass it to the testrunner utility. If you do so, then both above mentioned problem won't occur in first place.

     

    For example:

    Create Property file as below (have used only a few for demo, say project.properties

     

     

    username=test@test.onmicrosoft.com
    tokenResource=http://test.mccadevdpat.onmicrosoft.com/ 
    cAD=test.onmicrosoft.com
    cId=1111111-11111-2222-9560-b348ad0a5e89
    pauseIntervalSeconds=60
    maxAttempts=100
    JS_workflowPath=adl://test.azuredatalakestore.net/opt/rhi/test-test/latest/conf/workflow.xml

     

    How to pass property file to testrunner command?

    testrunner.bat -Dsoapui.properties.MY_PROJECT_NAME="/abs/path/project.properties" <other options> <project path>

     

    Note: In the above, replace MY_PROJECT_NAME with actual value of your project name( which you see in SoapUI tool)

    Refer documentation for the same : https://www.soapui.org/scripting---properties/working-with-properties.html

     

    Hope this is helpful.

4 Replies

  • nmrao's avatar
    nmrao
    Champion Level 3

    nkasemsan

    Not exact sure what is the issue there.

     

    Couple of suspects:

    1. The entire command should be in single line. Please check if it is in multiple lines.
    2. There are some slashes, colons etc in the property values. Wrap the value between double quotes (").

    Suggestion:

    There are so many properties that are being passed from the command line. Instead create a property file (key = value pair) and pass it to the testrunner utility. If you do so, then both above mentioned problem won't occur in first place.

     

    For example:

    Create Property file as below (have used only a few for demo, say project.properties

     

     

    username=test@test.onmicrosoft.com
    tokenResource=http://test.mccadevdpat.onmicrosoft.com/ 
    cAD=test.onmicrosoft.com
    cId=1111111-11111-2222-9560-b348ad0a5e89
    pauseIntervalSeconds=60
    maxAttempts=100
    JS_workflowPath=adl://test.azuredatalakestore.net/opt/rhi/test-test/latest/conf/workflow.xml

     

    How to pass property file to testrunner command?

    testrunner.bat -Dsoapui.properties.MY_PROJECT_NAME="/abs/path/project.properties" <other options> <project path>

     

    Note: In the above, replace MY_PROJECT_NAME with actual value of your project name( which you see in SoapUI tool)

    Refer documentation for the same : https://www.soapui.org/scripting---properties/working-with-properties.html

     

    Hope this is helpful.

    • PaulMS's avatar
      PaulMS
      Super Contributor

      Could the problem be quotes around the password property? -P"password"=*******

      as opposed to -PPR_resources=[\\\"OntologyPatient\\\"] 

      • nkasemsan's avatar
        nkasemsan
        Occasional Contributor

        Thanks for the suggestion.  I compared it to the SOAP project that ran successfully and that parameter is set that way.  It turns out my issue was due to the command line not being on one line.  After I removed the extra line, the test ran. 

    • nkasemsan's avatar
      nkasemsan
      Occasional Contributor

      Thank you.   The issue was the first one you suggested in which the command had to be in one single line.   My command was, in fact, in two lines.  After I removed the extra return, it ran as one single line and completed.