Take a screenshot outside of TestModule?

Class library usage, coding and language questions.
taralex
Posts: 57
Joined: Tue Nov 04, 2008 3:50 pm
Location: Michigan
Contact:

Take a screenshot outside of TestModule?

Post by taralex » Thu Feb 02, 2012 10:45 pm

I'm doing the following:

Code: Select all

TestReport.StartTestSuite("TestSuite");
TestReport.StartTestCase("TestCase");
Report.Screenshot();
TestReport.EndTestCase();
TestReport.EndTestSuite();
The screenshot is saved with the report, but I don't see it on the report. Now if I do Report.Screenshot within a TestModule, then it shows up ok. Is it a requirement that screenshots need to be only inside a TestModule?

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: Take a screenshot outside of TestModule?

Post by Support Team » Fri Feb 03, 2012 12:55 pm

Hi,
taralex wrote:The screenshot is saved with the report, but I don't see it on the report. Now if I do Report.Screenshot within a TestModule, then it shows up ok. Is it a requirement that screenshots need to be only inside a TestModule?
Sorry but this is not possible out of the box.
You should be able to transform the XSL file of your Report, because as you said the XML tag is available in the report. Now you have to adapt the XSL file to show the screenshot.

Why do you need this feature?

Regards,
Peter
Ranorex Team
.
Image

taralex
Posts: 57
Joined: Tue Nov 04, 2008 3:50 pm
Location: Michigan
Contact:

Re: Take a screenshot outside of TestModule?

Post by taralex » Fri Feb 03, 2012 3:26 pm

In my case I let the users create their test case files and it's up them to break them down to TestModules or not. But I want to always make a screenshot if a TestCase returns failure. So I noticed if the user doesn't bother to open a TestModule and log some info there, my screenshot doesn't show up on the report...

But thanks for the info, I'm going to look at the XSL file to see if I can modify it to show the screenshot.