Page 1 of 1

Screenshot in teardown with no failures?

Posted: Sun Aug 26, 2018 5:41 am
by PBMax
I'm using the Ranorex API in Visual Studio 2015 with Ranorex 8.2. When my test passes or fails my test cleanup runs and I always gets screenshots in the report. EnableTracingScreenshots is enabled and I didn't set the number of screenshots so I think the default is 3. Why am I getting screenshots in my teardown? I noticed in one test that there was an exception that was caught we log Info and Warning messages. We are also using Host.Local.TryFindSingle to find specific objects in test cleanup. I don't believe that code is supposed to capture a screenshot if it returns false.
                TestReport.BeginTestContainerTeardown();
                TestReport.BeginTestModule("Cleanup");
                //Code to close app
                Ranorex.Report.Info("Application Closed Successfully");
                TestReport.EndTestModule();
                TestReport.EndTestContainerTeardown();

Re: Screenshot in teardown with no failures?

Posted: Sun Aug 26, 2018 3:59 pm
by PBMax
I ran a larger test and it looks like the last 3 screenshots are attached for each module. I'm not sure if this is due to the first failure or not in the test suite. Is there API documentation that gives a little detail as to how this feature works?

Re: Screenshot in teardown with no failures?

Posted: Mon Aug 27, 2018 1:36 pm
by qwertzu
Hi PBMax,
Tracing screenshots should only be reported if your test fails. E.G. if an element during test run can't be found, Ranorex generally logs 3 screenshots.
Can you upload a compressed report report which contains the screenshots you are talking about?
regards, qwertzu

Re: Screenshot in teardown with no failures?

Posted: Mon Aug 27, 2018 4:45 pm
by PBMax
I've attached a screenshot instead of my actual report. If you can see, I have an Info and User log message in TearDown and got screenshots when those steps did not fail.

Re: Screenshot in teardown with no failures?

Posted: Wed Aug 29, 2018 1:03 pm
by qwertzu
Hey,
Can you show us how you implemented the closing of your application?
Thanks ;-)

Re: Screenshot in teardown with no failures?

Posted: Thu Aug 30, 2018 4:04 pm
by PBMax
Is there something you are looking for? A little more info would be helpful for me to investigate a little.

Re: Screenshot in teardown with no failures?

Posted: Fri Aug 31, 2018 7:52 am
by qwertzu
Hi,
Please post the whole code you are using in order to close the application.

regards, qwertzu