The code I've been using is:
Code: Select all
System.IO.Directory.GetCurrentDirectory()
So far this has worked very well when running via Ranorex Studio. However...
I have some tests that I run from command line, and the System.IO.Directory.GetCurrentDirectory() code will reference the folder where the .bat file is located, not where the .exe being run is located.
I could go through each test suite and add a condition to check if the current directory is the bin/Debug folder, but I feel like it's a little clunky. Has anyone else reference test files like this and have a more efficient way of doing so?