Find the Path of the Solutionfolder

Class library usage, coding and language questions.
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


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


User avatar
Support Team
Site Admin
Site Admin
Posts: 12169
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA

Re: Find the Path of the Solutionfolder

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


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;