Forum Discussion

Testranger's avatar
Testranger
Contributor
13 years ago

loadui sample not working

Hi all,

I'm trying out loudui and the sample(login logout) relies on test cases property transfer. I don't think this transfer is working cause there are so many fails. Am I doing something wrong?

Regards,
testranger

4 Replies

  • To elaborate further. Is passing of properties actually possible from one test case to another without using suite properties?
  • Yes, it is possible and strongly encouraged!

    Make sure to run the whole project - not just the scenario.
  • Actually it is not possible unless you use the following approach.

    The problem here is that the TestCase#sessionId property is scoped within a TestCase, i.e not normally accessible from another TestCase.
    Thus it would be preferable if you used the TestSuite property instead.

    However, if you really want use the Logout TestCase property instead, you could access the property using a Groovy TestStep in the end of the Login TestCase containing something like this:

    def sessionId = context.expand( '${#TestCase#response#declare namespace sam=\'http://www.example.org/sample/\'; //sam:loginResponse[1]/sessionid[1]}' )
    logoutTestCase = testRunner.testCase.testSuite.getTestCaseByName("Logout")
    logoutTestCase.setPropertyValue("sessionId", sessionId)