Page 1 of 1

BUG: RepoGenBaseFolder.SelfInfo.Path returns empty string

Posted: Thu Nov 21, 2013 6:11 pm
by krstcs
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 )

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

Posted: Thu Nov 21, 2013 7:59 pm
by krstcs
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.

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

Posted: Fri Nov 22, 2013 4:13 pm
by Support Team
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)

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

Posted: Thu Dec 05, 2013 1:41 pm
by Support Team
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)

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

Posted: Thu Dec 05, 2013 2:16 pm
by krstcs
Ah, that makes sense.

Thanks Markus