Page 1 of 1

Click

Posted: Mon Dec 02, 2019 7:16 am
by Kazann117
Good day, such a question does not always work click inside the browser how can I fix it?


if more precisely on certain parts of the screen, for example, click on edit on the site but it does not click, but for example clicks on

procedure TForm1.Simulate_Mouse_Click(X, Y: string);
var
MouseEvent : TCefMouseEvent;
KeyEvent : TCefKeyEvent;
begin
MouseEvent.x := strtoint(X);
MouseEvent.y := strtoint(Y);
Chromium1.Browser.Host.SendFocusEvent(true);
Chromium1.Browser.Host.SendMouseClickEvent(PCefMouseEvent(@MouseEvent), MBT_LEFT, false, 1);
Chromium1.Browser.Host.SendMouseClickEvent(PCefMouseEvent(@MouseEvent), MBT_LEFT, true, 1);
end;

Re: Click

Posted: Mon Dec 02, 2019 9:55 am
by salvadordf
Perhaps those functions can't be called so fast. Try adding a delay between the 2 SendMouseClickEvent calls to simulate a real click.

Re: Click

Posted: Tue Dec 03, 2019 6:56 pm
by ForestListener
This method does not work with clicking "I'm Feeling Lucky" button at Google.com

Does anybody has a suggestion to do it with SendMouseClickEvent?