BUG: HTML report opens in IE but not FF/Chrome from server

Bug reports.
krstcs
Posts: 2683
Joined: Tue Feb 07, 2012 4:14 pm
Location: Austin, Texas, USA

BUG: HTML report opens in IE but not FF/Chrome from server

Post by krstcs » Wed Mar 19, 2014 7:38 pm

Ranorex 5.0.1
Jenkins CI
Windows 2008

I am trying to publish my HTML report in Jenkins after each test run. I have Jenkins working correctly at this point, but the Ranorex Report itself will not work in Chrome or FF when served by the Jenkins web server, throwing the "Data file (Report.html.data) or transformation file is missing." error. It does work in IE with no error served from the same location.

We have users that work on Macs, so this has to work on Chrome/FF for them to be able to see the reports.

If I go to the folder that the report is in and directly open the report, it works fine in all browsers, it only fails when attempting to load the page from the web server in Chrome or FF. My guess is that the data file or XSL transform's network location is not being read correctly in FF/Chrome.
Shortcuts usually aren't...

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

Re: BUG: HTML report opens in IE but not FF/Chrome from server

Post by Support Team » Mon Mar 24, 2014 5:12 pm

Hi krstcs,

It seems to be a security issue.
Sorry for the question, but did you upload the *.data file as well?
Can you please try to start Chrome with the command line argument '--disable-web-security'?
Which version of Chrome and Firefox is installed on the Mac?
Is Javascript is enabled in Firefox?
Did you try to open the report on a Mac directly? I was able to open a Ranorex Report on Firefox on a Mac without any problems, but not using Jenkins.
I am not exactly sure if this is could be the problem, but on a Microsoft Internet Information Service (IIS) you have to add a MIME Type for the file name extension “.data” with the type “application/xml” as described in our blog Share your Ranorex Report using any Browser

Can you please explain how you added the files in Jenkins?

Regards,
Bernhard

krstcs
Posts: 2683
Joined: Tue Feb 07, 2012 4:14 pm
Location: Austin, Texas, USA

Re: BUG: HTML report opens in IE but not FF/Chrome from server

Post by krstcs » Mon Mar 24, 2014 6:10 pm

Bernhard, Jenkins does not use IIS, it is Java-based, using WAR files.

All files related to the report are uploaded correctly (or IE would also not work, but it does).

It is not a security issue, IE/FF/Chrome on the same system can all read the file directly without problem, it is only when the report is served through a web server that this problem exists. Also, I tried the Chrome command-line switch and it had no effect.

Javascript is enabled in FF (otherwise it wouldn't work if opened directly from the file, which it does).

I have not tried opening the reports on the Mac system since it isn't working on my Windows system, and it is not an issue with my local system. Until the issue is resolved on my system, it is unlikely to be available on Macs since they do not have IE.

In order to be more concise, the scenario is this:
If I open the report directly (from a shared folder on the server) in FF/Chrome/IE on my system, it opens and works as expected.
If I open the report through the web server URL in IE on my system, it opens and works as expected.
If I open the report through the web server URL in FF/Chrome on my system, it displays the error message.

If this was a permissions issue, it would not work under any of these situations.
Since I am not using IIS to server the reports, this is not related to IIS.
Since it works in one browser but not others, it must be related to how the page is being read by the browser. Since all other pages from the same server are being read correctly, it is limited to the Ranorex report file. Since it is failing in exactly the same spot (reading the .data.html file) it is most likely a script issue with Ranorex's javascript where the report's script is not getting the correct path to the data file.

NOTE: When I put the data file's URL path into the browsers, all browsers download the data file, which means that it is available from the path correctly.


This is all from the same client system, and the same server/folder.

It appears that the data location is not being referenced correctly in the report script when opened from the web server url in FF/Chrome. My guess would be that the javascript in the Report is not setup correctly to be served from a web server into a FF/Chrome browser session, which probably means that the "initXmlFirefox" function needs to be adjusted to account for a web/URL-based path.
Shortcuts usually aren't...

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

Re: BUG: HTML report opens in IE but not FF/Chrome from server

Post by Support Team » Tue Mar 25, 2014 5:00 pm

Hi krstcs,

My apologies for the confusion. I know that Jenkins does not use IIS.
I meant it could be a similar issue as in IIS and that it could be that you also have to add the MIME-Type for the “.data” extension. I tried to add it, but it seems to be not as simple as in ISS.
I am able to reproduce the issue using the "HTML Publisher plugin".I don't know if you are also using this plugin.
Unfortunately I could not find a workaround until now, but we continue analyzing it.

Regards,
Bernhard

krstcs
Posts: 2683
Joined: Tue Feb 07, 2012 4:14 pm
Location: Austin, Texas, USA

Re: BUG: HTML report opens in IE but not FF/Chrome from server

Post by krstcs » Tue Mar 25, 2014 5:32 pm

Yes, that is the plugin I am using as well.

I have been debugging the script and it has the correct information. The problem is that at line 2106, the Ranorex script is looking for the XML in the xmlhttp.responseXML field, but the data file's XML is actually returned in the response and responseText fields, but isn't parsed from there.

It might be a mime issue, where the server is presenting xml as text, but I'm not sure how to change it either.
Shortcuts usually aren't...

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

Re: BUG: HTML report opens in IE but not FF/Chrome from server

Post by Support Team » Tue Mar 25, 2014 5:51 pm

Hi krstcs,

I have already tried to decompile the package and add the mime-type.
<mime-mapping>
    <extension>data</extension>
    <mime-type>application/xml</mime-type>
</mime-mapping>
The problem is that the manifest is no longer correct, so I cannot recompile it.

Regards,
Bernhard

krstcs
Posts: 2683
Joined: Tue Feb 07, 2012 4:14 pm
Location: Austin, Texas, USA

Re: BUG: HTML report opens in IE but not FF/Chrome from server

Post by krstcs » Tue Mar 25, 2014 7:16 pm

OK, I've moved Jenkins over to a Tomcat server, I'm trying to set the mime for data to application/xml. However, it still doesn't work like that. I've restarted the service a couple of times to no effect.


But, I tried something else:

I copied the Report.html.data to Report.html.xml.
I then had to go into the Report.html and change the ".data" to ".xml" on line 3369.

I reloaded, and it worked. So, it MUST be a mime issue.

Not sure why adding data to the mime setup isn't working. I'm going to try a few more things, but I'm not confident at this point.

Thanks for the help, Bernhard!
Shortcuts usually aren't...

krstcs
Posts: 2683
Joined: Tue Feb 07, 2012 4:14 pm
Location: Austin, Texas, USA

Re: BUG: HTML report opens in IE but not FF/Chrome from server

Post by krstcs » Tue Mar 25, 2014 7:25 pm

OK, after a bit of further work, I realized that my Jenkins web.xml was over-riding the Tomcat one, so I fixed that and it seems to work.

By the way, you shouldn't have to de-compile. You should have a WAR folder that contains the web.xml where you put the mime mappings.
Shortcuts usually aren't...

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

Re: BUG: HTML report opens in IE but not FF/Chrome from server

Post by Support Team » Wed Mar 26, 2014 1:22 pm

Hi krstcs,

Please find attached a custom *.rxlog (extension was already changed to *.html) file. Using this file you should be able to see the Ranorex report on Chrome and Firefox as well.

Please let me know if this doesn't work.

Regards,
Bernhard
You do not have the required permissions to view the files attached to this post.

krstcs
Posts: 2683
Joined: Tue Feb 07, 2012 4:14 pm
Location: Austin, Texas, USA

Re: BUG: HTML report opens in IE but not FF/Chrome from server

Post by krstcs » Wed Mar 26, 2014 2:09 pm

Thank you Bernhard, but I won't need it, I got it working yesterday.

I just added the "data" mime type to all the web.xml files in all Jenkins locations, then restarted all instances. The file is located in <Jenkins Home>\war\WEB-INF\web.xml. It took it a few times for Jenkins to actually pick it up for some reason, but it is working now.

Problem was I had 2 location due to my config. I had changed one but not the other.


So, problem solved.
Shortcuts usually aren't...

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

Re: BUG: HTML report opens in IE but not FF/Chrome from server

Post by Support Team » Thu Mar 27, 2014 11:31 am

Hi krstcs,

Thank you for the information.
I am glad that you could solve the problem.

Regards,
Bernhard

Elizabeth.Mertl
Posts: 19
Joined: Wed Jan 25, 2012 10:47 am

Re: BUG: HTML report opens in IE but not FF/Chrome from server

Post by Elizabeth.Mertl » Wed Oct 15, 2014 4:45 pm

Hi!
We are having an issue with the HTML Reports of Ranorex (Version 5.0.2.17874) on the Jenkins Tomcat Server. we have gone through all the steps: renaming, mime type on the Server as well as Jenkins web config.
We can see the report in all browsers, but the problem is, if there are failed tests, except in IE, the images don't show up in any of the Browsers (lastest Version of Safari, Firefox and Chrome). The images URL are not decoded by the other browsers.
Eg: http://jenkins/Report/images%5CReport_8c15_trace.jpg

It should be: http://jenkins/Report/images/Report_8c15_trace.jpg

Thanks for the help in advance
Elizabeth Mertl

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

Re: BUG: HTML report opens in IE but not FF/Chrome from server

Post by Support Team » Mon Oct 20, 2014 1:16 pm

Hello Elizabeth,

May I ask you to update to our latest version (Ranorex 5.2)? Therefore, please proceed as shown below:
  • • Completely uninstall Ranorex from your machine.
    • Reboot the machine.
    • Install Ranorex 5.2
Please let us know if you are still facing the issue.

Note: Always backup your Ranorex solutions before updating to a newer version.

Thanks,
Robert

Elizabeth.Mertl
Posts: 19
Joined: Wed Jan 25, 2012 10:47 am

Re: BUG: HTML report opens in IE but not FF/Chrome from server

Post by Elizabeth.Mertl » Mon Oct 20, 2014 1:47 pm

Hi Robert!
Thanks for the reply. I actually tried the whole exercise on an IIS Web Server and it worked on all Browsers. Apparently this could be an Apache Tomcat issue. However we will try the Update, although I don't think it will solve the problem.
Warm Regards
Liz

harshil sanghvi
Posts: 1
Joined: Wed Jan 27, 2016 11:44 am

Re: BUG: HTML report opens in IE but not FF/Chrome from server

Post by harshil sanghvi » Wed Jan 27, 2016 12:07 pm

Hi,

I am facing similar issue on opening Html reports through Jenkins server. I get the below result when I click on the HTML Link on jenkins. This is occurring for IE/Chrome. Please help
You do not have the required permissions to view the files attached to this post.