Manual build is different from Ranorex build

Ask general questions here.
aleksv
Posts: 8
Joined: Tue Feb 20, 2018 7:12 am

Manual build is different from Ranorex build

Post by aleksv » Wed Apr 18, 2018 9:39 am

I read the jenkins blogpost and tried to setup Ranorex to work with my jenkins installation and discovered a strange problem. I created a Excel datasource and put it in a project. I am using the datasource in other projects too and so I set a relative path to the other project.

Here are the settings directly from the studio:
2018-04-18_10h31_07.png
2018-04-18_10h31_07.png (13.16 KiB) Viewed 285 times
Here are the settings from the debug folder (generated with Ranorex)
2018-04-18_10h31_25.png
2018-04-18_10h31_25.png (11.95 KiB) Viewed 285 times
Here are the setting from the debug folder (generated with jenkins)
2018-04-18_10h31_43.png
2018-04-18_10h31_43.png (11.96 KiB) Viewed 285 times
The jenkins job obviously can't find the Excel file. Any ideas how to fix this issue?
Last edited by aleksv on Fri Apr 20, 2018 9:44 am, edited 1 time in total.

aleksv
Posts: 8
Joined: Tue Feb 20, 2018 7:12 am

Re: Jenkins build is different from Ranorex build

Post by aleksv » Thu Apr 19, 2018 6:00 am

I just found out that if I build the solution manually via CMD the same happens. Are there special parameters that are set by ranorex before the build?

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

Re: Jenkins build is different from Ranorex build

Post by odklizec » Thu Apr 19, 2018 12:33 pm

Hi,

I guess you are not including the data connector file in your solution? Simply include the file to solution and set its property Copy to output directory to Always. Then simply change the path to data connector file to Dataver\Config\ranorex_config.xlsx (without ..\) and you are done. From now on, Ranorex will always copy the xlsx to bin\debug|release\Dataver\Config\ranorex_config.xlsx and access the file from there. Hope this helps?
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

aleksv
Posts: 8
Joined: Tue Feb 20, 2018 7:12 am

Re: Jenkins build is different from Ranorex build

Post by aleksv » Thu Apr 19, 2018 12:56 pm

I already did what you suggested. The Excel file can be found in the debug folder in both cases (manual build and ranorex build) but the reference in the .rxtst-File (the one in the debug folder) is wrong.

When Ranorex builds the projects it looks like this:
2018-04-19_13h52_18.png
2018-04-19_13h52_18.png (6.42 KiB) Viewed 268 times
When I do a manual build it looks like this:
2018-04-19_13h51_12.png
2018-04-19_13h51_12.png (6.45 KiB) Viewed 268 times
As you can see the path is different and thus the file can't be found in the second case.


I forgot to add that I put the file in a folder of another project. So that's why there is a relative path.
"Copy to ouput directory" is set to "Always"

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

Re: Jenkins build is different from Ranorex build

Post by odklizec » Thu Apr 19, 2018 1:06 pm

Is there something special about your build? Usually, if you build the solution, all included files should be always (automatically) copied to bin\debug|release folder (of course, with enabled Copy to output directory). Also, what happens if you remove ..\ from path in the data connector configuration dialog? There should be no need to use jump to above folder, if the "dataver" folder is located right in the solution folder.

Here is how I usually organize my data in solution...
DataFolder.png
DataFolder.png (23.65 KiB) Viewed 265 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

aleksv
Posts: 8
Joined: Tue Feb 20, 2018 7:12 am

Re: Jenkins build is different from Ranorex build

Post by aleksv » Thu Apr 19, 2018 3:01 pm

When I remove the ".." the file can't be found anymore.

Here is how I access the file from another project:
Image
Attachments
2018-04-19_15h59_38.png
2018-04-19_15h59_38.png (57.91 KiB) Viewed 260 times

aleksv
Posts: 8
Joined: Tue Feb 20, 2018 7:12 am

Re: Jenkins build is different from Ranorex build

Post by aleksv » Fri Apr 20, 2018 7:37 am

I found a workaround which works in Ranorex and on manual builds...

I want to access one Excel file from one project in all other projects... here is how it works:

As you can see here, in the main project I have a folder named "Config" which contains the ranorex_config.xlsx file.
Now I create the same folder in the other projects with the same content. Now I link all the datasources in the projects to their own config file.
When I am finished I delete all Config folders except the one in the main project.
Now Ranorex says it can't find the file (red dot before "File name") but it works! Now Ranorex builds and manual builds work with this setup (and of course jenkins)
2018-04-20_08h31_58.png
2018-04-20_08h31_58.png (20.48 KiB) Viewed 252 times
2018-04-20_08h32_48.png
2018-04-20_08h32_48.png (13.99 KiB) Viewed 252 times