| View previous topic :: View next topic |
| Author |
Message |
mgrinder
Joined: 14 May 2008 Posts: 2
|
Posted: Wed May 14, 2008 6:09 pm Post subject: Invoking private methods |
|
| Can Ranorex invoke private methods on a .NET control? |
|
| Back to top |
|
 |
Support Team Site Admin
Joined: 07 Jul 2006 Posts: 485
|
Posted: 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 |
|
 |
mgrinder
Joined: 14 May 2008 Posts: 2
|
Posted: 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 |
|
 |
Support Team Site Admin
Joined: 07 Jul 2006 Posts: 485
|
Posted: 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 |
|
 |
|