Repository folders do not inherit base path in C#

Bug reports.
Posts: 49
Joined: Thu Aug 20, 2009 11:28 am

Repository folders do not inherit base path in C#

Post by chrisgeorge » Tue Oct 13, 2009 9:31 am

We've hit this issue a few times now. In our element repository, we have nested folders to help organise things.

We need to be able to alter the base paths on these folders as some controls are instance based so the paths will change dependant on what else is open at that time.

However, while changing the base path on the parent folder is fine, we also have to change the base path on every child folder too! Inspecting the generated C# code shows that every folder at any level has the base path hard coded into the constructor of the folder class.

For example

I have a rooted folder

Code: Select all

public SomeRootFolder(RepoGenBaseFolder appFolder) : 
                    base("SomeTabControl", "container[@caption='']/element/element[@class='DockingView' and @instance='1']/*/*", appFolder, 5000, true)
                _setup = new SSMSRepoFolders.SetupFolder(appFolder);
And then a sub folder

Code: Select all

public partial class SetupFolder : RepoGenBaseFolder

            /// <summary>
            /// Creates a new Setup  folder.
            /// </summary>
            public SetupFolder(RepoGenBaseFolder appFolder) : 
                    base("Setup", "container[@caption='']/element/element[@class='DockingView' and @instance='1']/*/*", appFolder, 5000, true)
However, the base path of the sub folder is hard coded even though it will always be the same as it's parent rooted folder.

So to change the basepath in the rooted folder means I have to also change the base path on every sub folder.

Expected behaviour:

I should be able to change the base path on a rooted folder then have this inherited through any sub folders.
Chris George
Test Engineer

Red Gate Software Ltd

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

Re: Repository folders do not inherit base path in C#

Post by Support Team » Tue Oct 13, 2009 2:56 pm


We are aware of that problem.

For version 2.2, repository code generation has been changed (non-breaking) to accomodate the new "relaxed" repository structure (for example, nested rooted folders are now allowed, app folders can now be grouped under "simple" folders). These changes also automagically solve your problem. :D

Please let us know if you are interested in receiving a beta release of Ranorex 2.2.0

Ranorex Team