BUG: RepoGenBaseFolder.SelfInfo.Path returns empty string

Bug reports.
krstcs
Ranorex Guru
Posts: 2683
Joined: Tue Feb 07, 2012 4:14 pm
Location: Austin, Texas, USA

BUG: RepoGenBaseFolder.SelfInfo.Path returns empty string

Post by krstcs » Thu Nov 21, 2013 6:11 pm

I'm trying to loop through a set of TrTags inside a TableTag and need to use code to do it since there is no looping in the recording modules.

So, trying to use a repository object and get the basic path info for just that object (the TrTag) and one child object (a spantag) so I can just update the repository and not have to manage the paths in code.

I have the objects nested so that it looks like:

...
---->TBodyTag(folder)
-------->TrTag(folder)
------------>Span(item)

My code is a foreach(TrTag tr in TBodyTag), but I only want to get the TrTag's path, not the full absolute path, so I found that the SelfInfo.Path attribute returns just the repo path for the specific item, IF it is an item and not a folder. For folders it returns a blank string, when it should return the actual item path, like items do.

Please see the attached sample solution and test.html file that demonstrates the issue.

Edit: Using Ranorex 4.1.2. (I should know to include that by now... :D )
Attachments
FolderPathDemoTest.zip
(23.57 KiB) Downloaded 136 times
Shortcuts usually aren't...

krstcs
Ranorex Guru
Posts: 2683
Joined: Tue Feb 07, 2012 4:14 pm
Location: Austin, Texas, USA

Re: BUG: RepoGenBaseFolder.SelfInfo.Path returns empty string

Post by krstcs » Thu Nov 21, 2013 7:59 pm

Update: Found that the Folder.BasePath returns what I was looking for, but I still believe that the RepoItemInfo.Path should return the path as well and not a blank string, even if it is an overload of BasePath or something similar.
Shortcuts usually aren't...

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

Re: BUG: RepoGenBaseFolder.SelfInfo.Path returns empty string

Post by Support Team » Fri Nov 22, 2013 4:13 pm

Hello krstcs,

You are correct :-)
Only the BasePath returns the path value for a repository folder.
I have added a feature request into our internal bug-tracking system in order to discuss a possible future implementation of it. Thank you.

Regards,
Markus (T)
.
Image

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

Re: BUG: RepoGenBaseFolder.SelfInfo.Path returns empty string

Post by Support Team » Thu Dec 05, 2013 1:41 pm

Hello krstcs,

I got news from our development team regarding this issue.

This is currently by design, because the RepoItemInfo.Path always returns the Path from the ParentFolder.
For SelfInfo items (reflecting a folder) this is an empty path since they also reside inside the folder.
Unfortunately, there is no easy way to change that without changing the complete repository search mechanism and possible breaking changes.

Thank you for your understanding.

Regards,
Markus (T)
.
Image

krstcs
Ranorex Guru
Posts: 2683
Joined: Tue Feb 07, 2012 4:14 pm
Location: Austin, Texas, USA

Re: BUG: RepoGenBaseFolder.SelfInfo.Path returns empty string

Post by krstcs » Thu Dec 05, 2013 2:16 pm

Ah, that makes sense.

Thanks Markus
Shortcuts usually aren't...