Version specific repositories

Ask general questions here.
chrisgeorge
Posts: 49
Joined: Thu Aug 20, 2009 11:28 am

Version specific repositories

Post by chrisgeorge » Wed Sep 23, 2009 10:27 am

Hi,

We are developing a plugin to SQL Server management studio and as such have to test it across all of the versions (2005, 2005 express, 2008 etc). I want to be able to run the same test against each version.

What I would like to do is to create a ranorex repository for each of these (as some of the controls have subtly different paths). Then in my test, call a method that gets the repository for a specific version.

This all seems plausible, but then I realised that each of the repositories are created in their own class, so there is no generic class I can use. So I created an interface for the repository class which also seemed to be the answer... until I then realised that the XXXFolders class is created with the name of the main class which causes interface violations.

So at the moment I'm somewhat scuppered. Has anyone else managed to sort out a way of either loading repositories on the fly, or more generally, handing different versions of a product?


Chris
Chris George
Test Engineer

Red Gate Software Ltd
Cambridge

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

Re: Version specific repositories

Post by Support Team » Fri Sep 25, 2009 1:27 pm

Hi Chris,

as far as I understand you need an additional abstraction layer for your repository. Am I right? Because you said ...
... to test it across all of the versions (2005, 2005 express, 2008 etc) ...
It seems to me that in that case you have extremly different RanoreXPath expressions within the repository for each version.
I suggest to avoid the automatic creation of rooted folders within your repository.

In that case it's easier to provide robust interface for each repository item. You can create one repository for each version of your GUI application. Within the code you can use #ifdef statementes in combination with different build configurations to get the appropriate repository instance.

Would that be a solution for you?

best regards,

Christoph
Ranorex Support Team

simon.jackson
Posts: 1
Joined: Tue Oct 06, 2009 11:47 am

Re: Version specific repositories

Post by simon.jackson » Tue Oct 06, 2009 11:52 am

Cristoph,
Thanks for the response. Chris is away at the moment, but I'll try and answer for him. The thing that makes our case slightly interesting is that quite a lot of the subtrees between versions are the same, but they are rooted differently. So we might have

APath\AnotherPath\LongPath1, APath\AnotherPath\LongPath2, APath\AnotherPath\LongPath3... in one version
APath\YetAnotherPath\LongPath1,APath\YetAnotherPath\LongPath2, APath\YetAnotherPath\LongPath3 in another version.

If the paths were completely different then I agree we should deal with it outside of Ranorex, but we were hoping that we could use Ranorex to modify the "LongPath"s above, and only maintain the AnotherPath/YetAnotherPath distinction ourselves.


Simon

chrisgeorge
Posts: 49
Joined: Thu Aug 20, 2009 11:28 am

Re: Version specific repositories

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

Hi Christoph,

Sorry for the delay in replying to you.

Simon is partially right, most of the repository will be the same. However the path issue is not the main problem (as we can override these by changing the base paths on the repository object.

The main issue is where the rooted paths are the same but the final element path/id is different, perhaps a control has a different name now. For example, in the management studio connection dialog, the server type combo box is named "serverType" in 2005, but "comboBoxServerType" in 2008.

We would really like a way to modify the path of a specific element in the repository generated C# code before actually getting the element.

What we would rather not do is
1) have whole repositories for each version where the majority of the elements will be the same.
2) create our own accessor methods for each control to allow us to override them

I hope you can come up with an ingenious solution to our dilemma! :-)

Cheers

Chris
Chris George
Test Engineer

Red Gate Software Ltd
Cambridge

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

Re: Version specific repositories

Post by Support Team » Wed Oct 14, 2009 8:20 am

Hi Chris,

I suggest to manage in that case only the folders within the repository and to search for the appropriate item directly in code (beginning at the folder position).

You might have seen the VIP Database example application which is part of our datadriven example.
That appilcation contains a 'Gender' group box. What I want to show you is, how to search for the radio button elements within the container element, beginning at folder, which is provided by the repository.

Code: Select all

Ranorex.RadioButton rb = repo.VIPApplication.GroupBoxContainer.Find<Ranorex.RadioButton>("/radiobutton[@controlname='rbMale']");
                
// In your case it could look like that                
Ranorex.ComboBox cb = repo.YourApplicationFolder.YourSubFolder.Self.Find<Ranorex.ComboBox>("/combobox");
                
// Note: The Find method searches within the element tree (beginning at the RanoreXPath
// position provided by 'YourSubFolder') and not within the repository
Now, you should always get the required combobox element, regardless of what type of DB application you're using.

kind regards,

Christoph,
Ranoerx Support Team