Absolute RxPath from RepoItemInfo : General Questions

Absolute RxPath from RepoItemInfo

Ask general questions here.

Absolute RxPath from RepoItemInfo

Postby max » Fri Jan 22, 2010 11: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.

Regards
Max
max
 
Posts: 8
Joined: Mon Oct 12, 2009 4:43 pm

Re: Absolute RxPath from RepoItemInfo

Postby Support Team » Fri Jan 22, 2010 3: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;
}

Regards,
Alex
Ranorex Support Team
User avatar
Support Team
Site Admin
 
Posts: 4289
Joined: Fri Jul 07, 2006 5:30 pm
Location: Graz, Austria


Return to General Questions

Who is online

Users browsing this forum: No registered users and 1 guest