Strange behavior of DoDefaultAction() and Mouse.ClickElemen : Automation API

Strange behavior of DoDefaultAction() and Mouse.ClickElemen

Class library usage, coding and language questions.

Strange behavior of DoDefaultAction() and Mouse.ClickElemen

Postby lasombra » Tue Mar 18, 2008 4:56 pm

As mentioned in my post http://www.ranorex.com/forum/open-modaldialog-blocks-testclient-t354.html I have a strange behavior, that an element found, has the wrong coordinates, such that Mouse.ClickElement() does not work.
Well I have a loop, that is looking for an element and press a menu button. If the button is pressed by Mouse.ClickElement() the first time, this works well. But the following times the element has the wrong coordinates and thus the mouse cursor goes to the wrong position.

For the same test case I try to use the [code]DoDefaultAction(). The behavior of this is similar: The first time all works well, the following times the DoDefaultAction() does nothing.

While debugging I see, that the correct element is found and the default action is "press". So why it does not what I expect?

My Version of Ranorex: 1.2
lasombra
 
Posts: 9
Joined: Tue Mar 04, 2008 2:36 pm

Postby Support Team » Tue Mar 18, 2008 5:56 pm

Could you please post the code snippet the problem occurs in? In particular the loop and the search code! How many items are accessed within the loop?

This might be a problem of the element caching algorithm (see topic Problems automating Infragistics DataGrid control) which is fixed with the upcoming 1.4 Ranorex release, but I'm not sure of that.

If you are trying to click menu items, the best way is to use the Menu or MenuStrip class which both provide a SelectItemText method.

Regards,
Alex
Ranorex Support Team
User avatar
Support Team
Site Admin
 
Posts: 4845
Joined: Fri Jul 07, 2006 5:30 pm
Location: Graz, Austria


Return to Automation API

Who is online

Users browsing this forum: No registered users and 1 guest