Forum Discussion

scar2004's avatar
14 years ago

SoapUI3.5 - No such property: testRunner for clases: Script1

When I run a soapUI case with script
def targetStep = testRunner.testCase.getTestStepByName( "Properties" ) (Porperties is the properties file in my TestSuite)
I failed with alert "No such property: testRunner for clases: Script1".
Note: Before upgrade my SoapUI to 3.5 from 3.0.1, I have uninstalled the SoapUI 3.0.1 and clear it from my regedit.

Anyone can help me? Thanks a lot!

7 Replies

  • SmartBear_Suppo's avatar
    SmartBear_Suppo
    SmartBear Alumni (Retired)
    Hi!

    that explains it, the assertion script does not have access to the testRunner variable, you can instead use

    def testCase = messageExchange.modelItem.testCase

    to get hold of the containting testcase.

    regards!

    /Ole
    eviware.com
    • chathurad's avatar
      chathurad
      Contributor

      that explains it, the assertion script does not have access to the testRunner variable, you can instead use

       

      So how to get access to the testRunner variable?

      • yousufbadar's avatar
        yousufbadar
        Regular Visitor

        try this :

         

        def testCase = messageExchange.modelItem.testCase

        def ResponseMessage = testCase.testSteps["Step1"].testRequest.response.contentAsString

        log.debug 'response is :::: ' + ResponseMessage

  • SmartBear_Suppo's avatar
    SmartBear_Suppo
    SmartBear Alumni (Retired)
    Hi!

    Exactly where in soapUI are you running this script? Can you attach a screenshot?

    regards!

    /ole
    eviware.com
  • Borges's avatar
    Borges
    New Contributor
    Hallo,
    i run the script in an assertion(see screenshot)
    Regards
    Borges