0

We need to set the test case name dynamically at run time. I'm using WebTestFactory to execute same test case with different parameters but we need to provide different test case name for each run.

Please advise.

Karthi
  • 479
  • 2
  • 9
  • 21
  • What is the reason for setting the test name at runtime? Is your intention to tell the executions of the same method apart? The difference (in parameters) is shown in the test report (and you can fiddle with the final report as well if you need something custom). If you are looking to output something as the test method runs, then Reporter.log() might help. – patrungel May 11 '13 at 08:38

1 Answers1

0

TestNG has an interface org.testng.ITest. Implement this interface by implementing

public String getTestName();

In your test methods, set parameters so that getTestName() can return a meaningful name.

Bob Dalgleish
  • 8,167
  • 4
  • 32
  • 42