How to click a MFC Element

Ask general questions here.
vengaishiva
Posts: 62
Joined: Wed Mar 09, 2011 4:40 pm

How to click a MFC Element

Post by vengaishiva » Mon Jul 04, 2011 9:02 am

Hi,
I have a MFC date control in my application. Ranorex identifies it as 'Element'. I want to click the Element through code. But there is no method Click for Element class. How can achieve clicking on that element?

Code is like this:
Element ele = "rxpath of element";
ele.Click() //How to achieve this?

Regards,
Siva R S

User avatar
sdaly
Posts: 238
Joined: Mon May 10, 2010 11:04 am
Location: Dundee, Scotland

Re: How to click a MFC Element

Post by sdaly » Mon Jul 04, 2011 10:25 am

You could try ele.InvokeAction("Click", null); or declare as Ranorex.Unknown rather than Element.

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: How to click a MFC Element

Post by Support Team » Mon Jul 04, 2011 10:51 am

sdaly wrote:ele.InvokeAction("Click", null);
That InvokeAction will not work, but as you said using Ranorex.Unknown instead of Element does :-)
Ranorex.Unknown ele = "rxpath of element";
ele.Click()
Regards,
Alex
Ranorex Team
.
Image

vengaishiva
Posts: 62
Joined: Wed Mar 09, 2011 4:40 pm

Re: How to click a MFC Element

Post by vengaishiva » Mon Jul 04, 2011 11:36 am

Thanks a lot.
Ranorex.Unknown worked :D