Sikuli command to click button within HTML5 canvas object fails

Asked by zhenya on 2018-08-16

First time I've encountered this issue while using SikuliX IDE.
So I decided that it is some kind of a bug and installed PyCharm for work directly with sikuli api.
But I've encountered the same issue.

It looks like as follows:
There is a button within HTML5 canvas object. It is active in the means that it gets into active
state (frame appears) upon mouse cursor rollover. Mouse cursor changes states twice: upon button
rollover and after button click.

What I can see:
1. Mouse cursor rolled over the button (mouse cursor and button have changed accordingly)
2. Mouse cursor changed as if button was clicked. But button was not clicked.

From time to time it works though.
Which makes me ever more frustrated, because in my opinion it happens just under the same conditions.

Question information

Language:
English Edit question
Status:
Solved
For:
Sikuli Edit question
Assignee:
No assignee Edit question
Solved by:
masuo
Solved:
2018-08-17
Last query:
2018-08-17
Last reply:
2018-08-17
Best masuo (masuo-ohara) said : #1

Try low-level-mouse actions.
You can control delay time at click actions by using mouseDown() etc.
http://doc.sikuli.org/region.html#low-level-mouse-and-keyboard-actions

[example1:]
mouseMove("image.png")
wait(2)
mouseDown(Button.LEFT)
wait(1)
mouseUp(Button.LEFT)

[example2:]
mouseMove("image.png")
wait(2)
click("image.png")

zhenya (zhenya.kozhevnikov) said : #2

Thanks masuo, that solved my question.