Page 1 of 1

[Forms] Automation of Custom Control

Posted: Wed Sep 26, 2012 10:00 am
by WernerP
Hello!

I am just testing ranorex to automate a WinForms Application written in C# using a custom control. The control is userdrawn and as it is open source i have the source code.

After investigating some time searching the forums and reading the user doc i did not find the proposed way to automate the plugin- I did try the GDI approach but it did not work for me (no nested subcontrols were found).

What is the porposed way to automate such a control?

Re: [Forms] Automation of Custom Control

Posted: Wed Sep 26, 2012 12:52 pm
by Support Team
Hi,

Are you able to identify the element with Inspect or with the AccExplorer?
Which Ranorex version are you using?
Could you send us a Ranorex snapshot file of your application?
Following link will show you how to generate a snapshot file:
Creating Ranorex Snapshot Files.
In general if a WinForms control cannot be identified with Ranorex there are two ways how you can overcome this issue, you can add accessibility to enable Ranorex to identify this control as described in the following blog: Enabling automation for 3rd party controls by adding Accessibility, or you can use invoke remotely to remotely execute a specific method/perform a specific action as described in the following blog and forum posts: Transferring data to and from a .NET control, link1, link2 and link3.
If you have additional questions regarding your code we would also need the source code in order to guide you through this.

Regards,
Markus
Ranorex Support Team

Re: [Forms] Automation of Custom Control

Posted: Wed Sep 26, 2012 1:05 pm
by WernerP
Hi Markus,

thanks for your fast reply- funny thing is i am using exactly the control used in the blog entry- I will look into this- thanks a lot.

Re: [Forms] Automation of Custom Control

Posted: Wed Sep 26, 2012 1:22 pm
by Support Team
Hi,

You're welcome!
I am glad I was able to point you to the right blog entry :D.

Regards,
Markus
Ranorex Support Team