Double click works inconsistently

Asked by Selva

I am using java - sikulixapi.jar jar and in some of the png,
I have issue with double click.
--
I look for the image exists , then double click -
but sikuli simply selects which is click() action.
The code will look like

if(scr.exists(sImagePathAndName )!=null){
      Thread.sleep(5000);
      scr.doubleClick(sImagePathAndName);
      Thread.sleep(3000);
      bThere=true;
      break;
     }
here - the scr. exists evaluated to True but the doubleClick - simply selects the image.
I have added necessary waits and hence I do not think timing will be the issue.
--
Do we have some alternate method for this - other than mouse action and would like the know the reason for this .

Thanks
Selva D

Question information

Language:
English Edit question
Status:
Answered
For:
SikuliX Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Selva (ganapathy-selva) said :
#1

Hi ,
I did a (nasty) workaround, but would like to have doubleclick() working perfectly.

workaround is
select the image first- scr.click()
then double click- scr.doubleClick()

Also, I would like to upload the image or page where the issue arises which would give better idea . Is it possible for me to upload some images in image format or as word doc?

Thanks
Selva D

Revision history for this message
RaiMan (raimund-hocke) said :
#2

If this "workaround" works, then it is not "nasty", but necessary by design:
It simply means, that the image found does not have focus (not prepared to accept clicks) in this moment (before the click intended click action))

One means is to click some (normally not reacting) part of the GUI/Window/application, to make it the frontmost (prepared to accept mouse/keyboard actions) - this is what you did.
The other is to us the App.focus()/switchApp() feature.

Can you help with this problem?

Provide an answer of your own, or ask Selva for more information if necessary.

To post a message you must log in.