Hiya
In our test framework we have a class that produces performace test results as a graph
The graph is help in memory as a Bitmap object but can also be saved to an external file
Id like the bitmap to be part of the ranorex log file
Can this be done?
Thanks
Report bitmap
- Support Team
- Site Admin
- Posts: 12145
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Houston, Texas, USA
- Contact:
Re: Report bitmap
Hi atom,
yes it can be done. Use the Report.LogData() method and assign the bitmap to the 'object data' parameter.
e.g.
Christian
Support Team
yes it can be done. Use the Report.LogData() method and assign the bitmap to the 'object data' parameter.
e.g.
Bitmap bmp = new Bitmap(...); Report.LogData(ReportLevel.Info,"Info",bmp);Regards,
Christian
Support Team
Re: Report bitmap
nice one!
So what types does LogData recognise?
I was kind of suspicious that it might try to convert the object to a string and then log the string
Thanks
So what types does LogData recognise?
I was kind of suspicious that it might try to convert the object to a string and then log the string
Thanks
Re: Report bitmap
BTW for other automation people... check out ZedGraph
Its a free graphing library, pretty useful for reporting results as Bar / Pie / Line graphs
Its a free graphing library, pretty useful for reporting results as Bar / Pie / Line graphs
- Support Team
- Site Admin
- Posts: 12145
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Houston, Texas, USA
- Contact:
Re: Report bitmap
Report.LogData currently only recognizes Bitmap objects, so for all other types it will just put the type name into the report.
Regards,
Alex
Ranorex Support Team
Regards,
Alex
Ranorex Support Team
-
- Posts: 49
- Joined: Thu Aug 20, 2009 11:28 am
Re: Report bitmap
Has anyone actually managed to get a bitmap to display in a report?
We're generating image diff's and using LogData I tried displaying one of these diff Bitmap's in a report but it just displays nothing. Viewing the generated html (using Firefox plugin WebDeveloper) shows that the RanorexReport.xsl does not seem to be handling the image part of the xml.
I'm using 2.1.4.
We're generating image diff's and using LogData I tried displaying one of these diff Bitmap's in a report but it just displays nothing. Viewing the generated html (using Firefox plugin WebDeveloper) shows that the RanorexReport.xsl does not seem to be handling the image part of the xml.
I'm using 2.1.4.
Chris George
Test Engineer
Red Gate Software Ltd
Cambridge
Test Engineer
Red Gate Software Ltd
Cambridge
- Support Team
- Site Admin
- Posts: 12145
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Houston, Texas, USA
- Contact:
Re: Report bitmap
Yepp, I have using the following code
Regards,
Alex
Ranorex Support Team
Report.LogData(ReportLevel.Info, "SomeCategory", Imaging.CaptureImage(Host.Local)); // or ... Report.LogData(ReportLevel.Info, "SomeCategory", Host.Local.CaptureCompressedImage().Image);Just be sure that the type of the data you log is System.Drawing.Bitmap! That should work with all Ranorex 2.X versions.
Regards,
Alex
Ranorex Support Team
-
- Posts: 49
- Joined: Thu Aug 20, 2009 11:28 am
Re: Report bitmap
Hmm... I've used ReportLevel.Failure, does that matter? and yes I'm using a System.Drawing.Bitmap.
It is outputting the images (as jpg's) to disk, and it references them in the xml, but when viewing the xml in either the ranorex log viewer, or a web browser, it does not display them.
Chris
It is outputting the images (as jpg's) to disk, and it references them in the xml, but when viewing the xml in either the ranorex log viewer, or a web browser, it does not display them.
Chris
Chris George
Test Engineer
Red Gate Software Ltd
Cambridge
Test Engineer
Red Gate Software Ltd
Cambridge
- Support Team
- Site Admin
- Posts: 12145
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Houston, Texas, USA
- Contact:
Re: Report bitmap
You are right, the RanorexReport.xsl does not handle images right if the ReportLevel is different from Info. We'll correct that for the next version. Meanwhile, I attached the fixed RanorexReport.xsl to this post (contained in package RanorexReport.zip).
Regards,
Alex
Ranorex Support Team
Regards,
Alex
Ranorex Support Team
You do not have the required permissions to view the files attached to this post.
-
- Posts: 49
- Joined: Thu Aug 20, 2009 11:28 am
Re: Report bitmap
Cool! Yes that works. Is the xsl generated on the fly by Ranorex? or is it stored somewhere that I can overwrite with the one you sent?
Chris George
Test Engineer
Red Gate Software Ltd
Cambridge
Test Engineer
Red Gate Software Ltd
Cambridge
- Support Team
- Site Admin
- Posts: 12145
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Houston, Texas, USA
- Contact:
Re: Report bitmap
No, sorry, it is generated on the fly, so you can't just replace anywhere in the install directory. But you can replace it right after you call the Report.Setup method using your own file, i.e. the XSL will be generated by the Report.Setup method. So if you overwrite it afterwards with the fixed XSL, the fixed XSL should be used.
In the next Ranorex version (2.2.0) we add the functionality to configure a custom XSL file that is then referenced by the report files.
Regards,
Alex
Ranorex Support Team
In the next Ranorex version (2.2.0) we add the functionality to configure a custom XSL file that is then referenced by the report files.
Regards,
Alex
Ranorex Support Team
-
- Posts: 49
- Joined: Thu Aug 20, 2009 11:28 am
Re: Report bitmap
Ok, I've worked around it by using acombination of nunit asserts to mark the failure, then recording the failure in the log with ReportLevel.Info. It will do for now!
Thanks for your help!
Thanks for your help!
Chris George
Test Engineer
Red Gate Software Ltd
Cambridge
Test Engineer
Red Gate Software Ltd
Cambridge