Forum Discussion
SmartBear_Suppo
Alumni
13 years agoHi!
TestSuiteRunListener.beforeTestCase is called just before a TestCase is executed. If you have more than one TestCase configured it will be called once for each TestCase.
TestRunListener.beforeRun is called just before a TestSuite is executed.
Thus, you should probably use TestSuiteRunListener.beforeTestCase.
The syntax for retriving the TestCase name from the event handler is:
if you would like to use the TestRunListener.beforeRun for some reason it's:
where 0 is the index of the first TestCase.
--
Regards
Erik
SmartBear Sweden
TestSuiteRunListener.beforeTestCase is called just before a TestCase is executed. If you have more than one TestCase configured it will be called once for each TestCase.
TestRunListener.beforeRun is called just before a TestSuite is executed.
Thus, you should probably use TestSuiteRunListener.beforeTestCase.
The syntax for retriving the TestCase name from the event handler is:
testCase.name
if you would like to use the TestRunListener.beforeRun for some reason it's:
log.info testRunner.testSuite.getTestCaseAt(0).name
where 0 is the index of the first TestCase.
--
Regards
Erik
SmartBear Sweden