Page 1 of 1

How to locate the current rxlog working directory

Posted: Fri Jul 07, 2017 7:55 pm
by fester13579
Hello,

I want to know how to determine programmatically at run time where the current reports directory is located.

When I run my tests externally I would change my working directory before starting the Ranorex project exe file so I have a known base path to store my log files.

However when I run from Studio the path is located for example in "..\project name\reports\" since I am not running externally at that moment.

At the end of the current test I am working on I need to copy an external log file to the same directory as my report folder however since this can change depending on how I run the test I need to know programmatically where is my rxlog location is at any given moment.

I found the code

Code: Select all

TestSuite.WorkingDirectory 
but this is the the same location of the reports folder.


Any Thoughts?

Thanks...

Re: How to locate the current rxlog working directory

Posted: Sat Jul 08, 2017 6:45 am
by odklizec
Hi,

You can obtain report directory with this code:

Code: Select all

string reportDir = Ranorex.Core.Reporting.TestReport.ReportEnvironment.ReportFileDirectory;

Re: How to locate the current rxlog working directory

Posted: Tue Jul 11, 2017 3:42 pm
by fester13579
Thank you.