Hi,
I'm using Ranorex 7.0.1 and I'm needing to disable the screenshots of the report inside a code module, but only for a single validation.
I have some code that invokes some web service and evaluate the result. If some error is detected, I want to throw an error message on the report, mark the test case as failed, and stop the test execution and continue with next one.
I found that Ranorex.Validate.Fail("My error message"); does the thing I need, but it also produce a Screenshot (totally useless) in the report. I want to disable the screenshots but only for that sentence, but I want the screenshots for the rest of the test case (other sentences interacts with the UI and the screenshots are very usefull).
I can't find any reference about the code to do that. I tried the following code (probably it's wrong):
Ranorex.Validate.ResultOption vResultOption = new Ranorex.Validate.ResultOption();
vResultOption = Ranorex.Validate.ResultOption.Never;
Ranorex.Validate.Options vValidateOptions = new Validate.Options(vResultOption);
Ranorex.Validate.Fail("My erro message", vValidateOptions);
But nothing happened. The error on the report stills include the screenshot.
I would appreciate if someone could help me with that. Is very important to avoid taking screenshot on these senteces due to the overhead of snapshot and storage those pictures.
Thanks in advance!
Regards,
Simón
How to disable report screenshots by code
- Support Team
- Site Admin
- Posts: 12145
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Houston, Texas, USA
- Contact:
Re: How to disable report screenshots by code
Hello Sstellaccio,
Thank you for your post.
In order to turn off tracing screenshots, you might use the following line of code:
I hope this helps.
regards,
Stephan
Thank you for your post.
In order to turn off tracing screenshots, you might use the following line of code:
Code: Select all
Ranorex.Core.Reporting.TestReport.EnableTracingScreenshots=false;
regards,
Stephan
-
- Posts: 5
- Joined: Thu Sep 14, 2017 3:09 pm
Re: How to disable report screenshots by code
Hi Stephan,Support Team wrote:Hello Sstellaccio,
Thank you for your post.
In order to turn off tracing screenshots, you might use the following line of code:
I hope this helps.Code: Select all
Ranorex.Core.Reporting.TestReport.EnableTracingScreenshots=false;
regards,
Stephan
It worked perfectly for the purpouse. Thanks for your assistance. It was easier than I thought.
Best regards,
Simón