Ranorex

Invoking private methods

 
Post new topic   Reply to topic    Ranorex Forum Index -> RanorexNet
View previous topic :: View next topic  
Author Message
mgrinder



Joined: 14 May 2008
Posts: 2

PostPosted: Wed May 14, 2008 6:09 pm    Post subject: Invoking private methods
Can Ranorex invoke private methods on a .NET control?
Back to top
View user's profile Send private message
Support Team
Site Admin


Joined: 07 Jul 2006
Posts: 485

PostPosted: Thu May 15, 2008 10:56 am    Post subject:
Technically, invoking private methods would be possible. However, it is not supported since the names of private methods could interfere with the names of public methods.

Anyway, private methods are usually private for a reason. If you need to call the method, why not make it public or provide a public method that calls the private one?

Regards,
Alex
Ranorex Support Team
Back to top
View user's profile Send private message Visit poster's website
mgrinder



Joined: 14 May 2008
Posts: 2

PostPosted: Thu May 15, 2008 5:24 pm    Post subject:
Support Team wrote:
Technically, invoking private methods would be possible. However, it is not supported since the names of private methods could interfere with the names of public methods.

Anyway, private methods are usually private for a reason. If you need to call the method, why not make it public or provide a public method that calls the private one?


Because making the method public would require justifying the change to development. The developers are very resistant to making changes even if it makes QA's job easier. You obviously haven't actually used your product to test a real application. :-)

Well, I guess that rules out Ranorex for my particular set of problems.
Back to top
View user's profile Send private message
Support Team
Site Admin


Joined: 07 Jul 2006
Posts: 485

PostPosted: Thu May 15, 2008 6:24 pm    Post subject:
mgrinder wrote:

Because making the method public would require justifying the change to development. The developers are very resistant to making changes even if it makes QA's job easier.

Well, I think you got me wrong. What I meant is that usually there is no sense in calling private methods since they are not meant to be called from outside and may be changed or deleted at any time in development. If a private method should be callable, in other words if it should be part of the API, it needs to be marked public.

However, I can understand that there are reasons one would like to call private methods for testing, e.g. to set objects to a certain state. That's why I added this feature to our wanted features list for the next Ranorex version.

Regards,
Alex
Ranorex Support Team
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Ranorex Forum Index -> RanorexNet All times are GMT + 2 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum