Absolute RxPath from RepoItemInfo

Ask general questions here.
Posts: 8
Joined: Mon Oct 12, 2009 3:43 pm

Absolute RxPath from RepoItemInfo

Post by max » Fri Jan 22, 2010 10:52 am

Is it possible to get the absolute RxPath out of a RepoItemInfo?
The "Path" property of it just returns the relative path.
I think it would be a nice feature to get absolute paths from Info objects.


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

Re: Absolute RxPath from RepoItemInfo

Post by Support Team » Fri Jan 22, 2010 2:16 pm

In the upcoming Ranorex version 2.2.2 there is a new property RepoItemInfo.AbsolutePath that returns the absolute path of the repository item. With previous version, please, use the following code to generate the absolute path:
using Ranorex.Core.Repository;
RepoItemInfo info = myRepo.MyFolder.MyItemInfo;
RxPath absolutePath = info.Path;
RepoGenBaseFolder folder = info.ParentFolder;
while (folder != null)
    absolutePath = RxPath.Concat(folder.BasePath, absolutePath);
    folder = info.ParentFolder;
Ranorex Support Team