Forum Discussion
krenevla
11 years agoContributor
hello, is there any way how to acess testRunner now with 4.5.2?
I need to run following code from script assertions
or is there any workaround?
I need to run following code from script assertions
def assertWas = context.expand( '${get connected meter#Response#declare namespace ns5=\'http://tieto.com/WMS/acknowledgement\'; declare namespace ack=\'http://tieto.com/WMS/GetDeliverySite\'; //ack:GetDeliverySiteResponse[1]/ack:Acknowledgement[1]/ns5:Status[1]}' )
def assertExp = "OK"
def assertWhat = "Response Code"
def caseName = testRunner.testCase.name
def errandId = context.expand( '${#TestCase#newConnectionErrandId-sub}' )
def tc = testRunner.testCase.testSuite.project.testSuites["common"].testCases["smartAssert"]
tc.setPropertyValue("assertWas",assertWas)
tc.setPropertyValue("assertWhat",assertWhat)
tc.setPropertyValue("assertExp",assertExp)
tc.setPropertyValue("caseName",caseName)
tc.setPropertyValue("errandId",errandId)
def runner = tc.run( null, false )
log.info "Status: $runner.status, time taken for TestCase was: $runner.timeTaken ms"
or is there any workaround?