Forum Discussion
nmrao
2 years agoChampion Level 3
It would be helpful if you share what you have already tried.
By the way, why do you not want to pass the name if no other way? Is there any constraints?
By the way, why do you not want to pass the name if no other way? Is there any constraints?
- shyne2 years agoOccasional Contributor
Hopefully this image makes it clearer Rao. I'm looking for a command or way that would work like my made-up "getTheTestCaseThatCalledMe()" function. The reason I'd rather not pass the value through is, there are well over a hundred calls to different CommonTest1 type test cases. It is of course do-able but it'd be cleaner, safer quicker and easier if we didn't need to.
The code shown in the image for "WhoCalledMe" Groovy script step:
log.info testRunner.getTestCase().getName().toString() /* equals "CommonTest1" */ log.info context.expand( '${#TestCase#input_passedInPropertyTestCaseName}' ) /* Equals the "ABC123" that I want, but requires that property value to be passed in */ //log.info testRunner.getTestCase().getTheTestCaseThatCalledMe().getName().toString() /* getTheTestCaseThatCalledMe() of course does not exist */
Related Content
Recent Discussions
- 19 days ago