Mouse.ClickControl on button click-event does not work : Bug Reports

Mouse.ClickControl on button click-event does not work

Bug reports and feature requests.

Mouse.ClickControl on button click-event does not work

Postby Schuco » Thu Feb 21, 2008 5:20 pm

When performing following code on a button click ( button5 )
Code: Select all
Ranorex.Form form = Ranorex.Form.Active;
Ranorex.Button b1 = form.FindButton("button1");
Ranorex.Button b2 = form.FindButton("button2");
Ranorex.Mouse.ClickControl(b1);
Ranorex.Mouse.ClickControl(b2);


button1 gets the focus, but will not be clicked ...
What I've done wrong ?
Schuco
 
Posts: 9
Joined: Thu Feb 21, 2008 5:16 pm
Location: Ternitz

Postby Support Team » Thu Feb 21, 2008 5:48 pm

Please check that the FindButton() method calls do not return null and that your buttons displayed correctly in the RanorexSpy (which is normally the case with buttons).

What kind of application are you automating: MFC, .NET, ... ?

It could help to use ClickControl() with "movetime" to check if the mouse is moving to the correct control.

Michael
Support Team
User avatar
Support Team
Site Admin
 
Posts: 4297
Joined: Fri Jul 07, 2006 5:30 pm
Location: Graz, Austria

Postby Schuco » Thu Feb 21, 2008 11:56 pm

It's a c# windows form.
The mouse is moving to button1 and the button gets the focus, but the click-event does not occur.

I'll try your suggestions tomorrow !
Thank you !
Schuco
 
Posts: 9
Joined: Thu Feb 21, 2008 5:16 pm
Location: Ternitz

Postby Schuco » Fri Feb 22, 2008 9:12 am

I've tried it, nothing, same effect, but no click - event occurs !

OK, button does not get the focus !
button2 gets the focus, from then it works even on button1, the first "Ranorex" - click after a human click does not work
Schuco
 
Posts: 9
Joined: Thu Feb 21, 2008 5:16 pm
Location: Ternitz

Postby Support Team » Fri Feb 22, 2008 2:40 pm

I built a fake c# app with 2 buttons in it and a textbox to log the click.

The following code works for me:

Code: Select all
Form fake = Application.FindFormTitle("FakeApp");
Button b1 =  fake.FindButton("button1");
Button b2 = fake.FindButton("button2");

Mouse.ClickControl(b1);
Mouse.ClickControl(b2);


The only thing I can think of is your use of Form.Active. Try to use FindForm() instead.

If that doesnt work, please send your test app to support@ranorex.com.

Michael
Support Team
User avatar
Support Team
Site Admin
 
Posts: 4297
Joined: Fri Jul 07, 2006 5:30 pm
Location: Graz, Austria


Return to Bug Reports

Who is online

Users browsing this forum: No registered users and 0 guests