How to locate the current rxlog working directory

Ask general questions here.
fester13579
Posts: 30
Joined: Thu Feb 13, 2014 10:29 pm

How to locate the current rxlog working directory

Post by fester13579 » Fri Jul 07, 2017 7:55 pm

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...

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

Re: How to locate the current rxlog working directory

Post by odklizec » Sat Jul 08, 2017 6:45 am

Hi,

You can obtain report directory with this code:

Code: Select all

string reportDir = Ranorex.Core.Reporting.TestReport.ReportEnvironment.ReportFileDirectory;
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

fester13579
Posts: 30
Joined: Thu Feb 13, 2014 10:29 pm

Re: How to locate the current rxlog working directory

Post by fester13579 » Tue Jul 11, 2017 3:42 pm

Thank you.