Forum Discussion
SmartBear_Suppo
Alumni
16 years agoHello,
Hmm, I don't think there is a better way really... So if your solution works then I would stick with it. If you don't wish to use a Property, you could simply add it to the RunContext. For example, if you add the following event handlers:
You can then access the level variable using a Property Expansion: ${level}, or in a Groovy Script using: context.level
I'm not really sure if this is any better than what you already have. As I said, if it already works, I'd stick with it.
Regards,
Dain
eviware.com
Hmm, I don't think there is a better way really... So if your solution works then I would stick with it. If you don't wish to use a Property, you could simply add it to the RunContext. For example, if you add the following event handlers:
//ProjectRunListener.beforeRun
if(context.level == null)
context.level = "Project"
//TestSuiteRunListener.beforeRun
if(context.level == null)
context.level = "TestSuite"
//TestRunListener.beforeStep
if(context.level == null)
context.level = "TestCase"
You can then access the level variable using a Property Expansion: ${level}, or in a Groovy Script using: context.level
I'm not really sure if this is any better than what you already have. As I said, if it already works, I'd stick with it.
Regards,
Dain
eviware.com