How to upload Ranorex report in TeamCity?

Ask general questions here.
vadim
Posts: 14
Joined: Tue Apr 16, 2013 8:22 am

How to upload Ranorex report in TeamCity?

Post by vadim » Wed Dec 04, 2013 10:26 am

Hi,

I'm trying to make Ranorex report visible in TeamCity Build-level Report Tab.
Here is TeamCity instruction how to add HTML report:
http://confluence.jetbrains.com/display ... ld+Results

Ranorex report folder (including index.html, index.html.data and other generated files) is successfully stored as build artifact.
The issue is that when I open Report tab I see the following message:
Data file (index.html.data) or transformation file is missing.

Does anyone tried such method or any other method to upload Ranorex reports in TeamCity?
Or maybe it is possible to merge index.html and index.html.data in 'single' index.html file?
Thanks in advance for help.

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

Re: How to upload Ranorex report in TeamCity?

Post by Support Team » Fri Dec 06, 2013 4:09 pm

Hello vadim,

I am not sure if TeamCity can handle Report Data files (*.html.data) since our Data file is not based on html.
I would recommend to contact the Support Team for TeamCity to ask if this is possible.

Regards,
Markus (T)

vadim
Posts: 14
Joined: Tue Apr 16, 2013 8:22 am

Re: How to upload Ranorex report in TeamCity?

Post by vadim » Mon Dec 09, 2013 2:31 pm

Hi Markus,

Thanks, I will try to contact TeamCity support.

Cheers,
Vadim

ekirmayer
Posts: 1
Joined: Wed Dec 11, 2013 2:10 pm

Re: How to upload Ranorex report in TeamCity?

Post by ekirmayer » Wed Dec 11, 2013 2:12 pm

Hi,

Did you get an answer from TeamCity team about the reports?
Can this be done?

Thanks

vadim
Posts: 14
Joined: Tue Apr 16, 2013 8:22 am

Re: How to upload Ranorex report in TeamCity?

Post by vadim » Thu Dec 19, 2013 8:41 am

Hi, unfortunately, I din't get answer on TeamCity forum.

User avatar
BernhardS
Ranorex Guru
Ranorex Guru
Posts: 32
Joined: Tue Dec 17, 2013 6:35 pm

Re: How to upload Ranorex report in TeamCity?

Post by BernhardS » Mon Dec 23, 2013 2:11 pm

Hello vadim,

I am not exactly sure if this works, but would it be possible to rename the *.data file to *.data.html and upload it to Team City? After uploading the file, you can try to rename it back to *.data.

Regards,
Bernhard

JohnWashburn
Posts: 54
Joined: Wed Jan 09, 2013 7:02 pm

Re: How to upload Ranorex report in TeamCity?

Post by JohnWashburn » Thu Jul 30, 2015 8:43 pm

The work around is

1) Capture the Ranorex report elements as artifacts of the build execution.
2) One of the last build last steps of the build configuration renames any files within the artifacts directory with .rxlog in the name by replacing .rxlog with .html. The two files affected are:

<ReportLogFilename>.rxlog -> <ReportLogFilename>.html
<ReportLogFilename>.rxlog.data -> <ReportLogFilename>.html.data

3) Create an HTML tab (we named it RanorexReport) as part of the build configuration which takes the artifacts as its source.

Now TeamCity will display a tab to the left of the artifacts tab and is just coughing up an HTML page in its frame.

JohnWashburn
Posts: 54
Joined: Wed Jan 09, 2013 7:02 pm

Re: How to upload Ranorex report in TeamCity?

Post by JohnWashburn » Mon Sep 21, 2015 7:10 am

The final post processing we used was a TeamCity build step using the power shell runner with the following power shell script:

Code: Select all

trap
{
    write-output $_
    ##teamcity[buildStatus status='FAILURE' ]
    exit 1
}

#Creates the index file to organize multiple reports
$indexHTML = "%RANOREX_REPORT_DIR%\index.html"
$Head = '<head><title>Report Index</title>
<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>
<style>
    TABLE{width: 60%;border-width: 1px;border-style: solid;border-color: black;border-collapse: collapse;}
    TH{border-width: 1px;padding: 3px;border-style: solid;border-color: black;background-color:#bbcbdf}
    TD{border-width: 1px;padding: 3px;border-style: solid;border-color: black;}
    tr:nth-child(odd) { background-color:#ececec;} 
    tr:nth-child(even) { background-color:white;} 
    .Success {color:#44B049;}
    .Failed {color:#D84840;} 
</style></head>'
$Body= "<body align='center'><h1>Report Index</h1><table align='center'><tr><th>Test Suite</th><th>Status</th></tr>%REPORT_TABLE%</table></body>"
ConvertTo-Html -Head $Head -Body $Body | Set-Content $indexHTML

cd %RANOREX_REPORT_DIR%

Get-ChildItem -Filter "*rxlog*" -Recurse | Rename-Item -NewName {$_.name -replace 'rxlog','html' }
Which does 2 things:
1) it creates an HTML file named Index.html to use as the page to be displayed within the tab named: Ranorex View.
2) renames the Ranorex reporting files which contain HTML code from rxlog to html so any browser can display the results.