Find the Path of the Solutionfolder

Class library usage, coding and language questions.
Metin
Posts: 1
Joined: Wed Mar 11, 2015 1:33 pm

Find the Path of the Solutionfolder

Post by Metin » Wed Mar 11, 2015 1:46 pm

Hi,

I want that Ranorex capture the current Solutionfolder and safe it as "newVariable".
for my test i have the specific dataset in that folder.
By starting the programm i want ranorex write the captured path for finding that dataset.

best regards

Metin

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: Find the Path of the Solutionfolder

Post by Support Team » Fri Mar 13, 2015 1:34 pm

Hi,

As discussed via email.

You could get the path of the project folder using following code snippet:
var currDir = System.IO.Directory.GetCurrentDirectory();
var projectPath = System.IO.Directory.GetParent(currDir).Parent.FullName;
Afterwards simply store the value to a module variable.

Code: Select all

MyVariable = projectPath;         
Regards,
Robert
.
Image