Hello there,
RanorexStudio version 9.0.1
I was using Environment.CurrentDirectory to get the project path("D:\MyAutomationProject\bin\Debug\") that is stored on my RanorexStudio machine. When I start the remote execution using RanorexAgent I was getting the same folder path("D:\MyAutomationProject\bin\Debug\") as RanorexStudio machine.
I recently updated my RanorexStudio to 9.2.1.
Now for Environment.CurrentDirectory my RanorexStudio still returns ("D:\MyAutomationProject\bin\Debug\") but Ranorex remote agent returns ("C:\Users\MyAutomationUser\AppData\Local\Temp\Ranorex\fb8e00cc2cd5cb018183c8708888f07c\").
Can someone please tell me how to get the same path from Ranorex remote agent?
Environment.CurrentDirectory for RanorexAgent in 9.2.1
-
- Posts: 37
- Joined: Thu Aug 22, 2019 4:14 pm
Re: Environment.CurrentDirectory for RanorexAgent in 9.2.1
Hi
Use this code to get the working directory:
Use this code to get the working directory:
Code: Select all
TestSuite.WorkingDirectory.ToString();
Pavel Kudrys
Ranorex explorer at Descartes Systems
Please add these details to your questions:
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
-
- Posts: 37
- Joined: Thu Aug 22, 2019 4:14 pm
Re: Environment.CurrentDirectory for RanorexAgent in 9.2.1
Hi Pavel,
Thanks for your quick response.
I am still getting response as "C:\Users\MyAutomationUser\AppData\Local\Temp\Ranorex\fb8e00cc2cd5cb018183c8708888f07c\".
Thanks for your quick response.
I am still getting response as "C:\Users\MyAutomationUser\AppData\Local\Temp\Ranorex\fb8e00cc2cd5cb018183c8708888f07c\".

- Support Team
- Site Admin
- Posts: 12167
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Graz, Austria
Re: Environment.CurrentDirectory for RanorexAgent in 9.2.1
Hi Ajitpatil,
I am not sure why you were not seeing a different path before upgrading, but the current behavior is the expected behavior. This is because the Ranorex Remote Agent is copying the test to the remote machine's temp folder, hence why it is returning a different directory when run. If you are wanting it to return D:\MyAutomationProject\bin\Debug\ each time, specify this as a constant string instead of calling TestSuite.WorkingDirectory.
Cheers,
Ned
I am not sure why you were not seeing a different path before upgrading, but the current behavior is the expected behavior. This is because the Ranorex Remote Agent is copying the test to the remote machine's temp folder, hence why it is returning a different directory when run. If you are wanting it to return D:\MyAutomationProject\bin\Debug\ each time, specify this as a constant string instead of calling TestSuite.WorkingDirectory.
Cheers,
Ned