Namespace in Repository code

Ask general questions here.
atom
Posts: 357
Joined: Sun Dec 07, 2008 11:14 pm
Location: Dublin, Ireland

Namespace in Repository code

Post by atom » Wed Jul 15, 2009 6:34 pm

Hiya

When you generate VB.NET code from a saved repository
How to have no namespace ... if you leave the box empty the generated code wont compile

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

Re: Namespace in Repository code

Post by Support Team » Thu Jul 16, 2009 9:51 am

At the moment it`s not intended to set an empty namespace(by design). It`s a bug in the actual version of standalone spy/recorder that there is no warning dialog box. We will fix it till next release.
If you want to include an existing repository which is set to an empty namespace in Ranorex Studio, you can include the *.rxrep file instead of the .*vbnet file.

Regards,
Christian
Ranorex Support Team
.
Image

atom
Posts: 357
Joined: Sun Dec 07, 2008 11:14 pm
Location: Dublin, Ireland

Re: Namespace in Repository code

Post by atom » Thu Jul 16, 2009 1:24 pm

Could we add that if Namespace box is empty in Spy tool, then the "Namespace .... End Namespace" isnt generated in VB.net code?

Also, it would be a great feature to have an option to make the repository class properties private
Why? Well we wrap all main screens of the AUT into a business functions class
e.g. If you have a login form, the business function is to Login(UserName,Password)
The business function then uses the repository class to interact with the GUI

So from a test case point of view they should only perform business functions, and not work with the repository class itseld -> hence why id like that class as private or Friend

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

Re: Namespace in Repository code

Post by Support Team » Thu Jul 16, 2009 2:23 pm

No, you can`t edit the templates for code generation because they can`t be configured from outside(config-file...).

There are several ways to capsulate data from classes!
e.g. You can add an abstraction layer between the Ranorex Repository and your Business Class.

I think what you mean is to set all attribute members of the auto-generated static Repository Class(sealed) to private and add a new partialed Repository Class to set public functionality. Am I right?

Regards,
Christian
.
Image

atom
Posts: 357
Joined: Sun Dec 07, 2008 11:14 pm
Location: Dublin, Ireland

Re: Namespace in Repository code

Post by atom » Mon Jul 20, 2009 11:28 am

yep.
We will have the partial class generated by the repository, with all properties private
and the other partial class containing business functions, with public methods.

We'd also like one repository class to inherit from another
Basically we have 2 applications to test "App1" and "App2". App2 is build ontop of App1 so they share about 80% of the same GUI. We can easily build a repository for App1, but when we build a repository for App2, we need to inherit the repository of App1

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

Re: Namespace in Repository code

Post by Support Team » Wed Jul 29, 2009 3:12 pm

Hi,

we are currently discussing some optimization tasks for the Ranorex Repository tool and also for code generation and will consider your suggestions for further activities.
Many thanks for providing us your feedback and your ideas.

kind regards

Christoph
Ranorex Support Team
.
Image