Ubuntu - mouse problem - location and rightClick()

Asked by Jonas Eriksson

Hi,
I'm using sikulix API (Java) to run automated GUI tests on a jenkins machine running Ubuntu. Everything works great apart from one thing:
I want to right click on a file in the eclipse project explorer and hover/click on the context menu that should popup. I want to to this with the rightclick-function using a match object "m" and a Screen object s.

some code:
m = m.right().find("test***Generation/com_******_.png"); //Find the file
m.rightClick(); //Right click on it.
m = s.wait("test***Generation/******.png", 3); //Wait for the context menu to show up

This works fine on windows but refuses to work on Ubuntu. Now to the weird part, sikuli finds the picture and hovers to it. It seems to invoke some kind of click on it because it is marked but the context menu refuses to show up . Something I have noticed when running sikuli in Ubuntu is that the cursor does not always follow the click/hover, i.e when I'm clicking on things it is an "invisible cursor". When the tests are done and I'm touching the mouse the cursors always moves to a complete different place on the screen. The location that the cursor moves to when I'm touching the mouse is not right-clickable.

Another weird thing is when I only run the three lines of code mentioned above rightClick() works but there is still an "invisible cursor" doing the job. It is not working when I'm running the complete test suite, I'm only using functions from the sikuli API to move the mouse.

I'm sry that I can't post all code, Im currently working for a company developing GUI tests for their in house eclipse plugin (therefore the "*" in image path) and can't leave out to much information.

I know it might be very hard to reproduce/debug this but I thought that you might have some ideas of what could be the problem or give some tips on how to debug this. Please let me know if you need more information and I'll do my best.

Thanks for a great tool,
BR Jonas

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
RaiMan (raimund-hocke) said :
#1

Are you running a native Ubuntu on a separate machine sitting in front of a real screen, or is it some virtual environment?

If it is real: might be a click internal timing problem: you might setup your own click with the basic mouse ops and intermediate short waits.

Any other option (e.g. keyboard) to open the context menu?

Revision history for this message
Jonas Eriksson (jonaseriksson91) said :
#2

I'm running Ubuntu on a virtual machine (VMware) on my laptop.

I have tried this solution:

m.click(); // Focus the file
m.mouseDown(Mouse.RIGHT); //Right click file
Thread.sleep(300); //Wait a bit.
m.mouseUp(); //Release
Seems to work better but I still have this location issue. I now get the context menu and I can hover to the correct place. At this place I expect it to be marked and a submenu to appear to the right. But it is not marked and therefore no submenu appears. As I mentioned above, when I touch the mouse the cursor is moved to a complete different place. I suspect that this could be the problem, the "real" position is not where the cursor is and therefore it is not marked. I'm just assuming here, not an expert on this area.

You can open the context menu with the menu key but this is really the last solution I want to do. I hope this information helps a bit.

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

Is Sikuli running on the host system or directly inside the VM on Ubuntu?

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

BTW: what version of SikuliX?

Revision history for this message
Jonas Eriksson (jonaseriksson91) said :
#5

inside the VM on Ubuntu.

Revision history for this message
Jonas Eriksson (jonaseriksson91) said :
#6

I have a maven project that has sikulixapi-1.1.0-SNAPSHOT.jar.

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

Sorry, I have no idea and until mid August no time to go deeper into this problem.

Can you help with this problem?

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

To post a message you must log in.