Viewing XML results from TestNG Reports

247 views
Skip to first unread message

Jatin

unread,
Dec 25, 2012, 12:40:02 AM12/25/12
to testng...@googlegroups.com
Hi All

I am a newbie to TestNG , I use TestNG for running tests against my Web
server to test the REST APIs exposed by my server. It involves sending
of HTTP GET and HTTP POST requests. I have developed a client that can
do this job of sending the HTTP requests that exercise the REST APIs of
my server. I use TestNG here to drive the tests. Each request that i
send to the server is composed in a TestNG Test. What i mean here is
that each request that i send to the server is a TestNG test method
which i annotate using the "@Test" annotation available in TestNG.

Now, coming to the responses from the server. I receive the responses in
an XML format. As of the reporting is concerned i have not done anything
so far. What i do is to run the tests as a TestNG suite and view the
default report that we can view after the tests are run by opening the
index.html file. This is a nice report and it gives me as to which tests
passed and which tests failed. It has links for the tests run so when i
click on a particular test that was run i get to see some output on the
right pane. If the test is a failure then i get to see the exceptions in
the right pane. My requirement here is that when i click on the tests it
should show me the XML response that i received from the server so that
i see what is the output of the test. The reason why i am asking for
this is that in case there are some failed tests i would like to see the
results in the TestNG report itself. I actually save the responses in
another file for each of the tests but viewing the results in the TestNG
report would be more convenient.

In addition to this i also looked at the Reported API and tried using
the Reporter.log static method in each of my tests to see the response.
I did get to see the response but it is all jumbled up. The XML tags
dont show up properly and the XML output is properly formatted as we see
it a browser.

Appreciate your response in this regard. Also do let me know if i need
to provide more information in this regard.

Thanks
Jatin

Krishnan Mahadevan

unread,
Dec 25, 2012, 1:12:49 AM12/25/12
to testng...@googlegroups.com
You could build your own reporter by implementing the IReporter interface and plug it in as a listener if the existing reports dont meet your requirements. 
--
You received this message because you are subscribed to the Google Groups "testng-users" group.
To post to this group, send email to testng...@googlegroups.com.
To unsubscribe from this group, send email to testng-users...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/testng-users?hl=en.



--
Thanks & Regards
Krishnan Mahadevan

"All the desirable things in life are either illegal, expensive, fattening or in love with someone else!"
My Scribblings @ http://wakened-cognition.blogspot.com/

Krishnan Mahadevan

unread,
Dec 25, 2012, 5:52:38 AM12/25/12
to testng...@googlegroups.com
You could build your own reporter by implementing the IReporter interface and plug it in as a listener if the existing reports dont meet your requirements. 

On Tuesday, December 25, 2012, Jatin wrote:
--
You received this message because you are subscribed to the Google Groups "testng-users" group.
To post to this group, send email to testng...@googlegroups.com.
To unsubscribe from this group, send email to testng-users...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/testng-users?hl=en.

Reply all
Reply to author
Forward
0 new messages