Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » SWTBot » how to get screenshots, logger messages into results/${class-name}.html file?
how to get screenshots, logger messages into results/${class-name}.html file? [message #648083] Tue, 11 January 2011 07:33 Go to next message
Aparna Argade is currently offline Aparna ArgadeFriend
Messages: 18
Registered: October 2010
Junior Member
I'm using swtbot for last 2/3 months and had a good experience using it. I use headless test framework and I get .html, .txt and .xml in 'results' folder.
I often generate screenshots, logger messages to analyze failures. I got the screenshots in 'results' folder by specifying the folder name along with filename. I also generated logger output in 'results' folder by editing log4j.xml. But in this setup, all the things are scattered in different files.

I want to have a consolidated html report in which I should see all the things (screenshots, logger messages and standard html output with test pass/fail status etc.) in a single file.
That would be very easy to analyze the failure when you have lot many tests. Currently I've to first look at the .html. If there a failure then I've to open logger messages output file. I also need to open screenshots files side by side and then I can analyze the failure reason. It would be great help if all such things come in a single file.

I looked at JUNIT.XSL, library.xml in org.eclipse.swtbot.eclipse.junit4.headles_xxxx folder. But doing changes in those files seems difficult.
Is there any known standard method to get consolidated report including screenshots, logger output and html standard output?
Re: how to get screenshots, logger messages into results/${class-name}.html file? [message #648693 is a reply to message #648083] Fri, 14 January 2011 02:48 Go to previous messageGo to next message
Ketan Padegaonkar is currently offline Ketan PadegaonkarFriend
Messages: 873
Registered: July 2009
Senior Member
The only way I know of doing this would be to write a custom XSL file to
generate the right kind of html output with images and the logs embedded
in it.

I'd be glad to help out with any changes that need to be done in the
SWTBot end to help with this, and put this as an out-of-the-box feature
in swtbot.

--
Ketan
ketan.padegaonkar.name | eclipse.org/swtbot | @ketanpkr

On 1/10/11 11:33 PM, Aparna wrote:
> I'm using swtbot for last 2/3 months and had a good experience using it.
> I use headless test framework and I get .html, .txt and .xml in
> 'results' folder. I often generate screenshots, logger messages to
> analyze failures. I got the screenshots in 'results' folder by
> specifying the folder name along with filename. I also generated logger
> output in 'results' folder by editing log4j.xml. But in this setup, all
> the things are scattered in different files.
> I want to have a consolidated html report in which I should see all the
> things (screenshots, logger messages and standard html output with test
> pass/fail status etc.) in a single file. That would be very easy to
> analyze the failure when you have lot many tests. Currently I've to
> first look at the .html. If there a failure then I've to open logger
> messages output file. I also need to open screenshots files side by side
> and then I can analyze the failure reason. It would be great help if all
> such things come in a single file.
>
> I looked at JUNIT.XSL, library.xml in
> org.eclipse.swtbot.eclipse.junit4.headles_xxxx folder. But doing changes
> in those files seems difficult.
> Is there any known standard method to get consolidated report including
> screenshots, logger output and html standard output?
>
Re: how to get screenshots, logger messages into results/${class-name}.html file? [message #649179 is a reply to message #648083] Tue, 18 January 2011 03:03 Go to previous messageGo to next message
Ketan Padegaonkar is currently offline Ketan PadegaonkarFriend
Messages: 873
Registered: July 2009
Senior Member
On 1/10/11 11:33 PM, Aparna wrote:
> I'm using swtbot for last 2/3 months and had a good experience using it.
> I use headless test framework and I get .html, .txt and .xml in
> 'results' folder. I often generate screenshots, logger messages to
> analyze failures. I got the screenshots in 'results' folder by
> specifying the folder name along with filename. I also generated logger
> output in 'results' folder by editing log4j.xml. But in this setup, all
> the things are scattered in different files.
> I want to have a consolidated html report in which I should see all the
> things (screenshots, logger messages and standard html output with test
> pass/fail status etc.) in a single file. That would be very easy to
> analyze the failure when you have lot many tests. Currently I've to
> first look at the .html. If there a failure then I've to open logger
> messages output file. I also need to open screenshots files side by side
> and then I can analyze the failure reason. It would be great help if all
> such things come in a single file.
>
> I looked at JUNIT.XSL, library.xml in
> org.eclipse.swtbot.eclipse.junit4.headles_xxxx folder. But doing changes
> in those files seems difficult.
> Is there any known standard method to get consolidated report including
> screenshots, logger output and html standard output?
>

So I just did another spike, turns out that grabbing the screenshot and
putting it in a report is not all that difficult of a deal. I've opened
a bug(https://bugs.eclipse.org/334604) to make the screenshot as part of
the generated junit-report.

--
Ketan
ketan.padegaonkar.name | eclipse.org/swtbot | @ketanpkr
Re: how to get screenshots, logger messages into results/${class-name}.html file? [message #649213 is a reply to message #649179] Tue, 18 January 2011 08:43 Go to previous message
Aparna Argade is currently offline Aparna ArgadeFriend
Messages: 18
Registered: October 2010
Junior Member
Thanks Ketan for taking up the suggestion and implementing it so fastly. I took your changes and I can see the screenshots for the failled test.
With this base, I can take efforts to put intermediate screenshots (for a passed test as well) and also to add log messages in the same html, if possible.
Thanks once again.
Previous Topic:Hudson build available for swtbot
Next Topic:How to right-click in a column of a table
Goto Forum:
  


Current Time: Mon Dec 22 15:51:44 GMT 2014

Powered by FUDForum. Page generated in 0.01915 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software