Every Report.Info contains a screenshot on failure when run from module/editor

Ranorex Studio, Spy, Recorder, and Driver.
User avatar
lxsmkv
Posts: 14
Joined: Mon Jun 14, 2021 7:15 am

Every Report.Info contains a screenshot on failure when run from module/editor

Post by lxsmkv » Thu Jul 08, 2021 10:42 am

Hi Ranorexians ,

got Ranorex 9.5.3 here and a question.

I created a recoding module with user code step inside, where i use Report.Log
The strange thing is , when i run this module via "Run Recording" Button or from code editor with "Run Code" Button
and the function fails, then every Report.Info Line in Report Log before the "Error Module - Show/Hide Stacktrace" Line also contains a screenshot.
(I looked into the .data file of the log, it seems that its the same error image file linked to errimg attribute of every log item)

If i run the recodring module from a testsuite as a testcase, this doesn't happen. The Report.Info lines then don't contain any screenshots. Only the Error Line does, as expected.

It also makes no difference if i use Report.Info or Report.Log(ReportLevel.Info,

Can someone explain this logging behaviour? It looks like a bug to me, actually, because it makes no sense.

It matters because it makes the log much less readable when debugging. And imagine i may log hundreds of lines of data while debugging, where i want to check the text data and not screenshot thumbnail.

User avatar
odklizec
Ranorex Guru
Ranorex Guru
Posts: 7425
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

Re: Every Report.Info contains a screenshot on failure when run from module/editor

Post by odklizec » Fri Jul 09, 2021 7:08 am

Hi,

I can only speculate why it works like this, in case of individually started modules, however, there is a solution! Simply put this line to "init" section of each recording module:

Code: Select all

Ranorex.Core.Reporting.TestReport.TracingScreenshotCountLocal=1;
Apparently, it disables tracing screenshots for non-failure (info, warning, success) steps.
Pavel Kudrys
Ranorex explorer at Descartes Systems

Please add these details to your questions:
  • Ranorex Snapshot. Learn how to create one >here<
  • Ranorex xPath of problematic element(s)
  • Ranorex version
  • OS version
  • HW configuration

User avatar
lxsmkv
Posts: 14
Joined: Mon Jun 14, 2021 7:15 am

Re: Every Report.Info contains a screenshot on failure when run from module/editor

Post by lxsmkv » Fri Jul 09, 2021 10:19 am

Hi, Pavel,

It didnt work for me, the report still displays the screenshot for every info line. Which kinda makes sense, because its the same (one) screenshot, just linked many times.

Interestingly, if i set the value to zero

Code: Select all

Ranorex.Core.Reporting.TestReport.TracingScreenshotCountLocal=0;
Studio displays "Ranorex UI Access Launcher stopped working" dialog, but doesnt crash alltogether.

My first hypothesis was also, that it has something to do with tracing screenshots, so i went to Testsuite - [RMB] - Global Parameters - Report and set "Tracing Screenshots " option to "Off". But this had no effect in case of single module execution or code function execution.

User avatar
odklizec
Ranorex Guru
Ranorex Guru
Posts: 7425
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

Re: Every Report.Info contains a screenshot on failure when run from module/editor

Post by odklizec » Fri Jul 09, 2021 10:33 am

Hi,

Well, I'm afraid, it works for me? This is how my user code for given recording looks like and what's the result...
TracingScreenshots.png
TracingScreenshots.png (99.6 KiB) Viewed 702 times
Disabling/removing the code results to screenshot for every line.
Pavel Kudrys
Ranorex explorer at Descartes Systems

Please add these details to your questions:
  • Ranorex Snapshot. Learn how to create one >here<
  • Ranorex xPath of problematic element(s)
  • Ranorex version
  • OS version
  • HW configuration

User avatar
lxsmkv
Posts: 14
Joined: Mon Jun 14, 2021 7:15 am

Re: Every Report.Info contains a screenshot on failure when run from module/editor

Post by lxsmkv » Fri Jul 09, 2021 11:21 am

That's strange..
Screenshot_Bug_Info_Log_Screenshots.jpg
Screenshot_Bug_Info_Log_Screenshots.jpg (186.98 KiB) Viewed 699 times
P.S: i tried it also on a clean installation of Ranorex 9.5.3, it behaves the same.

User avatar
odklizec
Ranorex Guru
Ranorex Guru
Posts: 7425
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

Re: Every Report.Info contains a screenshot on failure when run from module/editor

Post by odklizec » Fri Jul 09, 2021 11:55 am

Could you please export your actual Ranorex Studio settings and post them here (zipped)? Just go to "Settings" and use "Export..." button. Thanks.
Pavel Kudrys
Ranorex explorer at Descartes Systems

Please add these details to your questions:
  • Ranorex Snapshot. Learn how to create one >here<
  • Ranorex xPath of problematic element(s)
  • Ranorex version
  • OS version
  • HW configuration

User avatar
lxsmkv
Posts: 14
Joined: Mon Jun 14, 2021 7:15 am

Re: Every Report.Info contains a screenshot on failure when run from module/editor

Post by lxsmkv » Fri Jul 09, 2021 12:20 pm

ranorex_settings.zip
(4.32 KiB) Downloaded 118 times

User avatar
odklizec
Ranorex Guru
Ranorex Guru
Posts: 7425
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

Re: Every Report.Info contains a screenshot on failure when run from module/editor

Post by odklizec » Fri Jul 09, 2021 1:10 pm

I'm afraid, it still works for me, even with your settings :) Just for fun, please try to run my solution (recording from it) on your PC.
MyTest8.zip
(603.26 KiB) Downloaded 108 times
Pavel Kudrys
Ranorex explorer at Descartes Systems

Please add these details to your questions:
  • Ranorex Snapshot. Learn how to create one >here<
  • Ranorex xPath of problematic element(s)
  • Ranorex version
  • OS version
  • HW configuration

User avatar
lxsmkv
Posts: 14
Joined: Mon Jun 14, 2021 7:15 am

Re: Every Report.Info contains a screenshot on failure when run from module/editor

Post by lxsmkv » Fri Jul 09, 2021 3:13 pm

Your solution worked on my side too.
Then I fiddled around with your solution, and found out that it somehow depends on the method you use to fail the function.

In particular, what i tried:

Code: Select all

			// Validate.AttributeEqual(BaseElement, "url", "apples" ); // works
			// Ranorex.Validate.AttributeContains(BaseElement, "url", "apples"); // works
			// Validate.Attribute(BaseElement, "url", "apples"); // works
			// Validate.AttributeRegex(BaseElement, "url", new Regex("apples")); // works
			// Report.Error("There was an Error"); // works
			// BaseElement.WaitForAttributeContains(new Duration(3000), "url", "apples"); // works
			// BaseElement.WaitForNotExists(new Duration(3000)); // works, assuming the website ranorex.info is open.
			// Validate.Exists(".//BigBlueButton"); // works
			
			// Validate.IsTrue(false); // doesn't work
			//int a = 1; Validate.IsFalse(Validate.Equals(a,a)); // doesn't work
			// Report.Failure( "That is a failure");// doesn't work
			// Validate.Fail(); // doesn't work
			// throw new Exception("Something went wrong"); // doesn't work
			// var c = 0; var b = 7 / c; // doesn't work
I did slightly generalized your solution for the test, using just base dom element as repoItem, and downgraded the dotNet requirement to recommended 4.6.2
MyTest8.zip
(607.2 KiB) Downloaded 107 times