Need help!!! Ranorex current path

Ask general questions here.
pansujit
Posts: 18
Joined: Mon Apr 18, 2016 2:56 pm

Need help!!! Ranorex current path

Post by pansujit » Thu Aug 04, 2016 9:00 am

Hi all,
I am working with ranorex 5.4.6. I succeeded integrate with jenkins. Now I am getting bunch of question:
1. while I ran on local machine, the getCurrentDirectory is \bin\debug but it is not true while, it shows another path. for example: a\b\c\bin\debug in local machine but a\b\c while running through jenkins.
Why this difference.
2. when I tried to get full path of any file "abc.txt" using Path.GetFullPath("abc.txt"), it returns a\b\c\bin\debug\"abc.txt" but it should be a\b\c\"abc.txt". I didn't copy to project. and when I search manually, there is no file with that name.

please help me.
Thanking you

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

Re: Need help!!! Ranorex current path

Post by krstcs » Thu Aug 04, 2016 3:00 pm

This appears to be an issue of not understanding how the Windows file system works. When you run an executable, the path is the directory tree you are running it from. Unless you re-create that same path on the test system, it will be different.

Why do you need it to be the same? If your tests are written correctly it shouldn't matter where you put it as long as Jenkins knows where it is so it can run it.
Shortcuts usually aren't...