Forum Discussion

New2API's avatar
New2API
Frequent Contributor
8 years ago

How to get Testcase Tag in a groovy script

Hi, I would like to get the tag name of a testcase in a groovy step.

 

intent:

def TagName = Get Current test's Tag

 

if(TagName == "Positive"){

                                                Do this

}else{

         do this

}

 

I used below scripts...

def ProjectTags = testRunner.testCase.testSuite.project.getTags()
log.info ProjectTags

def TC = testRunner.testCase.getTagIds()
log.info TC

 

Can you please provide some info one this?

TIA.

 

 

 

2 Replies