Forum Discussion

Theud's avatar
Theud
New Contributor
14 years ago

Using global property transfert with command line

Hello,

I have a question with SoapUI 3.6.
I created a TestSuite using property transfert. Properties are stored in soapui-settings.xml. When I launch the TestSuite with SoapUI all is working fine. My properties are updated and i can use them in an other request.

But i want to run the TestSuite in command line with testrunner.bat, my properties are not updated. Even if there is no error in the logs :


14:09:09,234 INFO [SoapUITestCaseRunner] running step [Property Transfer]


Is it a bug or only a non implemented feature?

Thanks

Theud

17 Replies

  • joefenton's avatar
    joefenton
    New Contributor
    Yeah, I renamed my project Test for ease. I have made what I am sure is a project property called "barcode" by double clicking on the project, selecting properties at the bottom of the window, and creating it there. This seems to create a custom property on the project tab on the left.

    I refer to it from the xml as you say, with ${#Test#barcode} and it does not work. It worked earlier when I was incrementing the barcode in the test case itself in a separate step, and it was a test case property so was referred to as ${#TestCase#barcode}, but it does not seem to want to access the project property, that can then be set from the command line?

    Thanks for your help,
    Joe
  • Use the word 'Project' verbatim, like: ${#Project#barcode}

    The part between #'s identifies not a specific project/test suite/test case, but the scope at which the property is defined.
  • joefenton's avatar
    joefenton
    New Contributor
    Thanks very much for that. Definite newbie here.
    The next issue I can't fathom following from this is an error while running TestRunner that says "Cannot invoke method plus() on null object."
    I can't understand this one as the test case works ok when just running it, and I am just asking that this be done from the command line with setting the project property barcode=xxx. I have even tried it without setting this property and just using a number and the same error occurs

    Joe
  • No problem.

    For your null object question... Open a new topic in the forum for this question. In the new topic, please post a snippet or attach the entire log so we can see more clearly what the error is, and where it is coming from.
  • Using SoapUI 3.6.1
    Similar behavior observed: testrunner.bat log (generated by Launch TestRunner) indicates everything ran successfully, including the explicit, Groovy scripted property transfer step, but the value was not transferred to the project or global level (transfers to both these levels is specified). The property transfer step works fine if the TestSuite is manually executed, but not from Launch TestRunner (from the shortcut menu) or from the command line. If the property transfer is already configured in a functioning test step, why are command line arguments, i.e., -G or -P necessary? Also, can command line arguments refer to response values? If so, what is the syntax? The example given refers only to a literal value (500).

    I'd appreciate any help.
  • To access TestSuite properties that have been transfered in multiple test cases, you need to save the project file after running the test case. From the UI, check the box next to "Sets to save the project file after tests have been run" in the Launch TestRunner window. On the command line, use the -S switch when you launch testrunner for a test case. Hope this helps.
  • Hi,

    Even I'm facing the same problem. I have 2 test cases - test case 1(login) and test case2(query). test case 1 logs into a system, obtains a session Id and sets it to a project level property. This property is used in test case 2.
    If I run these test cases manually from soap ui it works fine but it is not working when i run it using testrunner.sh from command line.

    SoapUI version - 4.5.1. Please help me

    Thanks,
    Ganga