Forum Discussion

whitecloud's avatar
whitecloud
Occasional Contributor
13 years ago

help on command line argument passing to project

Hi,

I searched the similar topic but still did not solve my puzzle. I try to pass a parameter from command line to project as a project level property. What I did is:

1. In soapUI GUI, right click on the project and open the "show project view" window, add a project property with name(ServerName), value().
2. Launch test running with command: testrunner.bat -r -a -j -fD:\SmartBear\Log -I -PServerName=DEV1 D:\SoapUI\code\Test.xml

After running, I open the project level window and expect to see the property 'ServerName' to have the value 'DEV1', but has no luck.

Any help is appreciated.

Thanks.

3 Replies

  • SiKing's avatar
    SiKing
    Community Hero
    -P will work only for that run
    -S will save everything back after the run
  • whitecloud's avatar
    whitecloud
    Occasional Contributor
    Thanks a lot for the reply and help. I have the groovy script in project 'Load Script' as below which print blank value (DEV1 is expected):

    def serverName = context.expand('${#Project#ServerName}')
    log.info "Server Name: " + serverName


    I do not know what is wrong with it. Any thought?
  • SiKing's avatar
    SiKing
    Community Hero
    Did you see the comment at the top of the Load Script tab?
    Load Script is invoked with log, project variables.