| View previous topic :: View next topic |
| Author |
Message |
dbi1463
Joined: 28 Nov 2007 Posts: 1
|
Posted: Wed Nov 28, 2007 11:58 am Post subject: Type casting |
|
I'm a TA of a Windows Programming course in a Taiwan univeristy. We use Ranorex (free edition) for GUI automation and testing. I has a class in a C# program: KeynoterView inherited System.Windows.Forms.Form. I used RanorexNet to start the application, and actually it works fine.
However, there still exists a problem that I want to cast Ranorex.Form to KeynoterView because I want to call some methods in KeynoterView for testing. How do I do? |
|
| Back to top |
|
 |
Support Team Site Admin
Joined: 07 Jul 2006 Posts: 435
|
Posted: Wed Nov 28, 2007 12:41 pm Post subject: |
|
I'm sorry, but C# casting doesn't work that way. Since Ranorex.Form does not inherit from KeynoterView, you cannot cast an instance of Ranorex.Form to your custom form.
Ranorex.Control (which is the base class for Ranorex.Form) is just a wrapper that makes properties and methods of a Control from a separate process available to the process running Ranorex. I.e., it's not an instance of the actual class running in your KeynoterView application.
Currently, Ranorex supports accessing the most common properties of Controls from another process. Ranorex 1.4 (Professional version) will include the possibility to access all public properties and methods of controls, even those of custom controls.
Regards,
Alex
Ranorex Support Team |
|
| Back to top |
|
 |
|