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?
Type casting
- Support Team
- Site Admin
- Posts: 12145
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Houston, Texas, USA
- Contact:
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
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