3

I am using LoadUI 2.6.8 and SoapUI 5.0.

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-integration/passing-along-testcase-properties.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.

Has anyone encountered this before? Any insight into why this would be happening? Thanks!

UPDATE: I managed to get around this issue by updating the Authentication API response to include the cookie as part of the response body (instead of just the header) and thus I was able to use the Property Transfer step which seems to work. This is still a workaround though.

Laura
  • 69
  • 4
  • If you use "maintain HTTP session" option in the testcase options, it will pass the Cookies around for you automatically. – SiKing Oct 30 '14 at 20:42
  • Thanks for the tip, I tried it and nothing changed. The test works fine in SoapUI but once I run it in LoadUI it doesn't. It seems to take the Property Value that was set in the test case from SoapUI and even though the groovy script runs successfully in LoadUI the value is not updated... its as if that part of the script never runs or gets ignored. And I know the rest of the script runs fine because I set the cookie header for the rest of the calls in the same test case in the same script and they all run successfully. – Laura Oct 30 '14 at 21:09
  • Assuming you are trying to pass around actual session Cookies, you cannot set them using setPropertyValue. See this: http://siking.wordpress.com/2013/07/25/soapui-cookie-management/ – SiKing Oct 30 '14 at 21:24
  • see my answer below (it was too long for a comment) – Laura Oct 30 '14 at 22:18

1 Answers1

-1

Thanks for the link SiKing, I think I actually ran across that while trying to figure out the cookies, which I eventually managed to get working by setting the headers manually using the script. In order to test if it was a cookie issue I used another property. I added the following line to the groovy script:

tc.setPropertyValue("testprop","blah")

ran it in SoapUI and the property value is set ok. I then changed the value of the test case property "testprop" in the SoapUI test case to "a" manually and saved the project.

In LoadUI I ran the SoapUI Runner and the output for this property shows as "a" eventhough the groovy script ran fine. The more I play around with it the more I think its some kind of bug in LoadUI :(

Laura
  • 69
  • 4
  • Now the questions is, if this is a bug then how to get around it if I only know the value that property should be set to in the groovy script? (i.e. can't use the property transfer step) – Laura Oct 30 '14 at 21:54