Page 1 of 1

Namespace in Repository code

Posted: Wed Jul 15, 2009 6:34 pm
by atom
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

Re: Namespace in Repository code

Posted: Thu Jul 16, 2009 9:51 am
by Support Team
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

Re: Namespace in Repository code

Posted: Thu Jul 16, 2009 1:24 pm
by atom
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

Re: Namespace in Repository code

Posted: Thu Jul 16, 2009 2:23 pm
by Support Team
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

Re: Namespace in Repository code

Posted: Mon Jul 20, 2009 11:28 am
by atom
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

Re: Namespace in Repository code

Posted: Wed Jul 29, 2009 3:12 pm
by Support Team
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