How to get Testcase Tag in a groovy script
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Please refer to the product's API documentation to learn the property you can use for this:
Tanya Yatskovskaya
SmartBear Community and Education Manager
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Tanya, Automation and scripting is relatively new for me. I did go through the API documentation, but couldn't find a method that would convert/present the Tag Ids in to Name.
As I mentioned earlier, I can extract tag names at project level. I would like to get test case tags at TestCase level to branch my test flow.
Thanks.
