Page 1 of 1

Does ranorex support Application’s Internals

Posted: Sun Jan 09, 2011 6:02 am
by blrohit
Does ranorex provide access to public, protected and private methods, properties and fields of an application’s visible and non-visible objects for white-box testing? If I want to call or access testing application's internal variables then can I reference the dll and call or access its methods/variables?

Re: Does ranorex support Application’s Internals

Posted: Mon Jan 10, 2011 7:29 pm
by Support Team
Yes, this is possible for .NET Windows Forms and partially for Flex/Flash applications. Although Ranorex is actually intended to do user-oriented testing, which is usually black-box testing.

For Flex/Flash controls Ranorex provides access to properties with simple types, e.g. strings, numbers, that can easily be converted to .NET types. See the FlexElement.GetPropertyValue and SetPropertyValue methods.

The Control adapter provides even greater flexibility for .NET Windows Forms. Additionally to GetPropertyValue and SetPropertyValue, you can also invoke methods (InvokeMethod) and even execute code (delegates) in the remote process (InvokeRemotely). For more information on the InvokeRemotely method please read the following blog:
http://www.ranorex.com/blog/transfering ... et-control

You might also want to read the following chapter on Ranorex GUI adapters from the Ranorex User Guide:
http://www.ranorex.com/support/user-gui ... apter.html

Regards,
Alex
Ranorex Team

Re: Does ranorex support Application’s Internals

Posted: Fri Jan 14, 2011 7:58 pm
by AlexDozer
Hello,

is there any way, maybe by a third party tool, to get instances from a WPF Application? Maybe, if not possible over the GUI, over the Process? I need the instance from one class to get additional information that are not displayed on the GUI.

Regards, Alex

Re: Does ranorex support Application’s Internals

Posted: Mon Jan 17, 2011 4:18 pm
by Support Team
AlexDozer wrote:is there any way, maybe by a third party tool, to get instances from a WPF Application?
I don't know of one, sorry!

What you can do as a workaround, though, is adding a small WinForms control to the WPF control (or the application) - see the WindowsFormsHost class. You can then use the Control.InvokeRemotely method on that WinForms control to execute a delegate in the process of the AUT. In that delegate you can then access the WPF control; you just need some way of getting the WPF control instance, e.g. a static variable or method that returns the WPF control you actually want information from.

Regards,
Alex
Ranorex Team

Re: Does ranorex support Application’s Internals

Posted: Mon Jan 24, 2011 11:10 am
by AlexDozer
Thank you!

I will discuss that with our developers.