Adding more information to html report.

22 views
Skip to first unread message

Lidia

unread,
Oct 27, 2009, 10:45:51 PM10/27/09
to testng-users
Hi

In our testing we call TestNG twice, to execute the same set of tests
on different browser. The end result is such that we have two sets of
results, stored under test-output/<browser> directory. In order to
check results, we have to view html reports for each browser
separately and can't tell from the report what browser it belongs to
(other than by url).

Is there a way to extend current TestNG reporter to add browser
information to the report xml file (testng-results.xml) so that it is
reported in the html reports?

Any input appreciated.

Thanks
Lidia

Cédric Beust ♔

unread,
Oct 27, 2009, 10:52:06 PM10/27/09
to testng...@googlegroups.com
Hi Lidia,

Sure, everything is possible :-)

If this extra information will be useful to all TestNG users, I'll be happy to accept patches to the existing reporter, but if it's more specific to your situation (which appears to be the case), you should probably just implement your own reporter...

--
Cedric
--
Cédric


Lidia

unread,
Nov 2, 2009, 11:56:54 PM11/2/09
to testng-users
Let me rephrase the question, to make it more generic.

By default tests are reported based on the test class/method names.
The question is, can I change them programatically?

I see from the API description, that I can provide testName when using
@Test annotation on the class. I get a browser name through system
property. I would like to append browser name to the testName (and
ideally method names as well). Is there a way to do it?

Thanks
Lidia

Cédric Beust ♔

unread,
Nov 3, 2009, 12:12:26 AM11/3/09
to testng...@googlegroups.com
Hi Lidia,


Yes, that's what org.testng.ITest is for:  override getName() and return the name of your test + name of the browser, and that name will appear in the HTML reports (see a thread earlier today on this very topic).

--
Cédric


Reply all
Reply to author
Forward
0 new messages