Forum Discussion

saketc's avatar
saketc
New Contributor
12 years ago

Property Transfer between Test Cases

hi,

As per this link, http://www.loadui.org/Load-Testing-soapUI-Tests/, one can transfer properties between test cases. But this doesnt work for me.

I am trying to pull out a sessionid from one Test case and passing it into another Test case.
Test Case1 (create Session id, save into Test case1 property using a Property transfer )
Test case 2( session id variable declared on Test case2 ) - At this stage I tried two different approaches

Approach 1- do nothing, as per the link, this is autjomatically transferred when runing in a loadui. That doesnt work.
Approach 2- a groovy script that reads the value from Test case1, and sets the value into Test case 2. That works in SOAPUI. Never works in LOADUI.

Cant find any reference for such a basic operation. Can anyone help please.

Rgds
S

4 Replies

  • Hi,

    What version of LoadUI are you using?

    Also this sounds like more of a LoadUI issue than SoapUI issue so changing to LoadUI category on forum.
  • Hi,

    You can transfer a property between test steps within a test case using the property transfer test step. It seems that you are expecting the property transfer to transfer a property between test cases.

    http://www.soapui.org/Functional-Testin ... alues.html

    Approach 1- do nothing, as per the link, this is automatically transferred when runing in a loadui. That doesnt work.


    Not sure what you mean by automatically transferred in LoadUI.

    Approach 2- a groovy script that reads the value from Test case1, and sets the value into Test case 2. That works in SOAPUI. Never works in LOADUI.


    Please post groovy script, and how you are invoking in LoadUI.
  • saketc's avatar
    saketc
    New Contributor
    HI,

    Apologies for the delay in replying.
    I define property - "sessionidProp" in Test Case 1, and define another property called "sessionidProp" in Test Case 2.
    The Test Case1 fetches the sessionId from a Response. And then does a property transfer to its property called "sessionIdProp"

    According to this link http://www.loadui.org/Load-Testing-soap ... rring.html,
    the property names on both test cases should be same.
    ". Please note that it's crucial that both of the TestCases have a TestCase Property with the same name!"
    But it doesnt seem to work for me.
    That is one problem.

    Another problem is that, in continuation with the above test case.
    If I write a groovy script which just reads the current property "sessionidProp" from Test Case1 & Sets it to "sessionIdProp" of Test Case2, i.e
    TestCase1.sessionIdProp --> TestCase2.sessionIdProp. This works fine in a normal test Run on soapui.
    In LoadUI pro, I wire the Test Case1 to Test Case2. And apply a load.
    But TestCAse2.sessionIdProp is not set correctly.
    Which bring me to the question -
    In LoadUI, does each TestCase run in its own Thread for each Request ?
    How does one flow any Information between Test Cases in loadui.

    I am using the latest versions - SOAP UI Pro 4.6.3(Trial) & Load UI Pro 2.6.6 trial.

    Thanks & Regards
    S
  • I am running into a similar issue as this one.

    I have been able to do Property Transfers into Test Case properties that are successfully passed between SoapUI Runners in LoadUI as described here: http://www.loadui.org/soapui-integratio ... rties.html

    The problem I am having is that one of the properties I am setting via a Groovy Script like this:

    def tc = testRunner.testCase.testSuite.getTestCaseByName("Auth and Start Up")
    tc.setPropertyValue("Cookie","$jsesid")


    is not being updated in LoadUI (when the groovy script runs) and thus not being passed around properly.

    I have to use a groovy script because the cookie comes in as part of the response header and the normal Property Transfer Step doesn't allow me to do the transfer.

    Its as if this part of the groovy script is ignored in LoadUI, the rest of the script works fine because I set the header for other calls within the same script and those run successfully.