[9.2] Rxlog data file being set to 0kb once test ends

Bug reports.
matthewk
Posts: 15
Joined: Wed Aug 23, 2017 12:10 pm

[9.2] Rxlog data file being set to 0kb once test ends

Post by matthewk » Mon Oct 21, 2019 1:31 pm

I upgraded to Ranorex 9.2 this morning.

We use TeamCity (TC) for CI. Our TC build agent copies all files from the bin/Debug folder over to a folder on a VM and executes the tests on that VM.

We then copy the report files back over to our build agent. Before the upgrade today everything was working perfectly.

Now, as the tests are running I can see the rxlog.data file growing in size but as soon as the tests finish running the rxlog.data gets set to 0kb and our reports are then broken with the following message:

The data file (my_project_name_here.rxlog.data) or transformation cannot be accessed. There are three possible reasons:
- The file does not exist in the current location.
- The test run is in progress and the data file is locked due to frequent saving operations. Wait until the test run has finished and increase the auto-save interval of the report for future test executions.
- The report contains invalid XML/XHTML, e.g. unclosed tags. Check code that uses the Report.LogHtml method to only log well-formed XHTML.

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

Re: [9.2] Rxlog data file being set to 0kb once test ends

Post by odklizec » Mon Oct 21, 2019 1:37 pm

Hi,

I'm too experiencing this error (The data file (my_project_name_here.rxlog.data) or transformation cannot be accessed.), after upgrading to 9.2. In my case, the rxlog.data file is available and does not appear to be corrupted. The problem appears to be project-dependent, because some other projects work just fine in 9.2. I've already sent an email to Ranorex support. But it definitely appears to be a Ranorex 9.2 bug.
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

matthewk
Posts: 15
Joined: Wed Aug 23, 2017 12:10 pm

Re: [9.2] Rxlog data file being set to 0kb once test ends

Post by matthewk » Mon Oct 21, 2019 1:43 pm

Thanks for the reply.

My rxlog.data file is present it has just been set to 0kb in size once the tests have finished.

Running locally through Ranorex Studio does not appear to have the same issue.

I'm going to try and debug a bit but may have to downgrade back to 9.1.2 for now

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

Re: [9.2] Rxlog data file being set to 0kb once test ends

Post by odklizec » Mon Oct 21, 2019 1:52 pm

I see. In my case, I found the error while running one particular test in Studio. Are you using custom report template in your test?
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

matthewk
Posts: 15
Joined: Wed Aug 23, 2017 12:10 pm

Re: [9.2] Rxlog data file being set to 0kb once test ends

Post by matthewk » Mon Oct 21, 2019 2:11 pm

Standard default report template.

I tested changing from .rxlog to .html in the settings but same issue seen.

I will report back if I manage to find anything else out about it - but it's looking like I need to go back to 9.1.2 for now

matthewk
Posts: 15
Joined: Wed Aug 23, 2017 12:10 pm

Re: [9.2] Rxlog data file being set to 0kb once test ends

Post by matthewk » Tue Oct 22, 2019 8:23 am

I couldn't get anywhere further so have downgraded back to 9.1.2 and everything is working correctly again - so definitely something not right with 9.2

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

Re: [9.2] Rxlog data file being set to 0kb once test ends

Post by Support Team » Wed Oct 23, 2019 9:07 am

Hello,

This is a known limitation with Ranorex 9.2.

The issue is caused if any report action is used after the test suite is completed, e.g. in the Program.cs.

We are already working on a fix for our upcoming release.

Thank you for reporting the issue.

Sincerely,
Ranorex Support Team
.
Image

ahoisl
Certified Professional
Certified Professional
Posts: 182
Joined: Fri Sep 07, 2007 8:16 am

Re: [9.2] Rxlog data file being set to 0kb once test ends

Post by ahoisl » Thu Oct 24, 2019 7:57 am

As our support team already explained, this should happen only if you log to the Report outside of a test suite, e.g. in the Program.cs file after this line

Code: Select all

error = TestSuiteRunner.Run(typeof(Program), Environment.CommandLine);
There is a workaround by calling

Code: Select all

Report.End()
at the very end of the execution, e.g. by placing the call at the very end of the Program.cs Main() method:
[STAThread]
public static int Main(string[] args)
{
    ...
    try
    {
        error = TestSuiteRunner.Run(typeof(Program), Environment.CommandLine);
    }
    catch (Exception e)
    {
        Report.Error("Unexpected exception occurred: " + e.ToString());
        error = -1;
    }

    Report.End();
    return error;
}
I'm sorry for the inconvenience this causes, we already have a bug fix and will deploy it with the next service release.

Regards,
Alex
Ranorex Team