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?
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...
On Tue, Oct 27, 2009 at 7:45 PM, Lidia <lid...@gmail.com> wrote:
> 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?
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?
On Mon, Nov 2, 2009 at 8:56 PM, Lidia <lid...@gmail.com> wrote:
> 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?
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).