Forum Discussion

krogold's avatar
krogold
Regular Contributor
7 years ago

testRunner command line : how to set testCase's property values

Hello,

 

I'm using testRunner in command line calls.

I can target a particular testCase with the options -s<my TestSuite> and -c<myTestCase>.

The testCase I want to play uses custom properties and I sometimes call it from another testCase, setting its property value at my convenience.

 

Is it possible to do the same using testRunner as a command line  ? ie. configuring the testCase's custom property  ?

there arer -D and -G options but I can't figure out if there suitable to do this.

 

has anyone been through this before ?

 

thank you

 

Alex

  • Nastya_Khovrina's avatar
    Nastya_Khovrina
    SmartBear Alumni (Retired)

    Hi,

     

    Thank you for your post! There is no special testRunner argument to specify test case custom properties. But, there is an argument for project properties: -P which specifies a value of a project property for the test run. This value will override the variable’s value during the run.

     

    Usage: -P<variable>=<value>. If the value includes spaces, enclose the entire argument in quotes. To override several variable values, specify the -P argument several times.

     

    Command-Line Arguments: https://support.smartbear.com/readyapi/docs/soapui/running/automating/cli.html

  • Hi krogold

     

    I am not sure about this how you can do this by command line.

     

    But if i have to deal with this situation, i just put the value in .txt or .xls file and read it by writting a groovy code into my TestSuite or TestCase or whereever i want to use the values.

     

    Thanks,

    Himanshu

    • krogold's avatar
      krogold
      Regular Contributor

      Thanks for the idea, but it will be quite complicated to implement.

      Indeed, I would like to execute simple tests that can also be called by more complex tests that pass values for the simple test's custom properties.

      so I would have to know if I launch the test via testRunner or via another testCase to make distinction and use properties from an external file or not ...

       

      Have you got any idea of how to determine if I'm running a test in command line or through soap ui in a groovy script ?