Forum Discussion

amysoap's avatar
amysoap
Occasional Contributor
7 years ago

Run Particular Test Steps on different suite in the Same Project

Hi ,

       I want to run particular test steps. I am getting null value when I run this code under the same project but different suite. My requirement is run specific test steps.

 

Project

Suite1

        Test Cases1

         Test Steps 1(Here is my Groovy code and needs to run Test Steps 2 under Suite2

 

Suite2

 

  Test Cases2

         Test Steps 2(This needs to be run)

 

def tCase = testRunner.testCase.testSuite.testCases["TC1_DDP_New_to_HSD_SIK"]

def tStep = tCase.testSteps["getTestCasesToExecute"]
log.info tStep
tStep.run(testRunner, context)

 

 

Could any one assist me Please

 

Thanks

Amy

 

 

4 Replies

  • gauravkhurana's avatar
    gauravkhurana
    Occasional Contributor

    def testStep=testRunner.testCase.testSuite.project.getTestSuiteByName("Name of suite whose TC you want").getTestCaseByName("Name of the test Case").getTestStepByName("Name of the step you want to run")

     

     

    testStep.run(testRunner,context)

     

    // The above code is working fine

    • amysoap's avatar
      amysoap
      Occasional Contributor

      Thank you. I am able to run now. Again Thanks

       

      • gauravkhurana's avatar
        gauravkhurana
        Occasional Contributor

        if the code worked for you, Support the answers by  Giving "kudos" to the aswer