Ask a Question

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

SOLVED
Nidhi26
Occasional Contributor

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 7
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?


Regards,
Rao.
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
Occasional Contributor

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

nmrao
Champion Level 3

DO you have any keywords to look for in the script?


Regards,
Rao.
Nidhi26
Occasional Contributor

yes i do have specific string to search for.

nmrao
Champion Level 3

@Nidhi26,

 

Please find if the below script resolves the issue and follow in-line comments.

 

https://github.com/nmrao/soapUIGroovyScripts/blob/master/groovy/MatchingScriptFinder.groovy



Regards,
Rao.
Nidhi26
Occasional Contributor

Thanks Rao for your quick response and help . it worked 🙂

cancel
Showing results for 
Search instead for 
Did you mean: