Forum Discussion

Nidhi26's avatar
Nidhi26
Occasional Contributor
7 years ago
Solved

how to fetch all the TC name and test step names that have db query?

In a soapu ui project suite, I want to fetch the TC name and test step names containing the db scipts.

I am using the code below, getting an issue at the line i.e underlined , tried few things but nothing worked.

If someone can help.

 

testRunner.testCase.testSuite.project.getTestSuiteList().each {
    if(it.name.equalsIgnoreCase("bank")){

      it.getTestCaseList().each {

      for (testSteps in it.testStepList){


          if(testSteps instanceof WsdlGroovyScriptTestStep ){
              log.info testSteps.name
              log.info testSteps.getContent() or testSteps.contains("db query")

          }
      }
  }  
}
}

7 Replies

  • nmrao's avatar
    nmrao
    Champion Level 3
    You mean to say that to list all the groovy steps? Do you just wanted to log those or want to capture the list to a variable? or how you want to use that data?
    • Nidhi26's avatar
      Nidhi26
      Occasional Contributor

      Have a requirement to update the db query that are used in the groovy scripts. Hence want list the test steps of specifc groovy scripts that contains db query.

      tried using contains function but unable to read the text written in groovy.

      • Nidhi26's avatar
        Nidhi26
        Occasional Contributor

        once identified the tc and test step names , it will be easy for me to update.