Forum Discussion

omensio's avatar
omensio
Contributor
15 years ago

Called tc need to access callers asset, how?

Hi!
Is it possible to get callers assets like Properties etc in called  test case.
Look attachment!There Write Log script  is working fine when beeing in the same context.
But after moved into separete test case the highligted lien mus be changed.

Olli

1 Reply

  • SmartBear_Suppo's avatar
    SmartBear_Suppo
    SmartBear Alumni (Retired)
    Hi Olli,


    When you say "Properties", having in mind the the code snippet you've attached, I assume you are referring to test request response

    You can access request and result objects using code similar to this snippet:

    import com.eviware.soapui.impl.support.http.HttpRequestTestStep

    log.info "Test result count: ${testRunner.results.size()}"
    def testCase = testRunner.testCase
    log.info "Test case: $testCase?.name"
    def int i = 1
    testRunner.results.each { testResult ->
    String testStepName = testResult?.testStep.name
    log.info "Test step $i '$testStepName': ${testCase.getTestStepByName(testStepName)}"
    if (testResult?.testStep instanceof HttpRequestTestStep) {
    log.info "Test step $i request: status $testResult?.testStep?.testRequest"
    }
    log.info "Test step $i result: status $testResult.status, size $testResult.messages, messages: $testResult.messages"
    ++i
    }

    I hope this is along the lines what you need.

    I recommend you using pro forums for getting prioritized support.


    Cheers!
    /Nenad Nikolic a.k.a. Shonzilla