Forum Discussion

VeJaay's avatar
VeJaay
Occasional Contributor
5 years ago
Solved

Need help in placing a script in tear down script.

I am generating report for each and every test case. The code for the report is placed in the tear down script. I make frequent changes to the report and its very difficult to change the code every t...
  • VeJaay's avatar
    VeJaay
    5 years ago

    Thanks JoostDG  for your help. But what I was looking is to place a report script in the teardown script using groovy code.I have found it and its working

     

    Here is the code : 

     

    testRunner.testCase.testSuite.project.getTestSuiteByName('Library').getTestCaseByName('Test2').setSetupScript('log.info "34324234"')
    
    def script = context.expand( '${#[Library#Test1#te]#script}' )
    
    log.info script
    
    testRunner.testCase.testSuite.project.getTestSuiteByName('Library').getTestCaseByName('Test2').setTearDownScript(script)