Forum Discussion

roglesby's avatar
roglesby
Occasional Contributor
10 years ago

Run Step for test case in an external project

I know it is possible to leverage test in a test suite using the Run Step to build out more modular test cases.

However working with a large team and due to the test structure of the application is it possible to leverage test cases across projects like a Library project that houses base service request that can be pulled into multiple projects across the team?

3 Replies

  • SmartBear_Suppo's avatar
    SmartBear_Suppo
    SmartBear Alumni (Retired)
    Hello,

    Unfortunately you cannot leverage TestCases across project, TestSuites is as far as it goes. Let me know if you have further questions.

    Regards,
    Temil
  • Let me know if this helps you.

    def prj = testRunner.testCase.testSuite.project.workspace.getProjectByName("ProjectName")
    tCase = prj.testSuites['TestSuiteName'].testCases['TestCaseName']
    tStep = tCase.getTestStepByName("TestStepName")
    def runner = tStep.run(testRunner, context)
    log.info ("runner status ....... : " + runner.hasResponse())
  • SmartBear_Suppo's avatar
    SmartBear_Suppo
    SmartBear Alumni (Retired)
    Hi,

    Yes this is possible and you can also set the property for that testname or the testcase using setPropertyValue. This is possible only using groovy scripting not out of the box. Thanks a lot for sharing.

    Thanks,
    Jeshtha