Coordinates problem, and Right-click problem

Hi,

I need to web scrap a page, and act on a context menu.
The URL is :
https://watabou.github.io/village-generator/?seed=1328009350&tags=coast,no%20square,isolated
(it is a map generator, running in WebGL).

I need to trigger a context menu. Clicking with a right-click action on the map…

In my UI Web Automation, I write script calling :

  • either clickAt (Selenium), targeting “css=canvas”,
  • or XClick, with x,y coordinates, and #right

BUT :

  • clickAt works only with left-click,
  • XClick, with coordinates, works with absolute coordinates (X,Y on my main Desktop, not relative to viewport of the active web tab).

Is there a solution ?
In case of XClick, is there a way to work in relative X,Y, or a way to convert absolute to relative, and vice-versa ?

Hi, that is not correct. In web mode, the coordinates are inside the viewport, so XClick | 0,0 is the top left corner of the browser viewport.

Hi,

Thanks for your reply.
This is what I supposed, reading the docs. But, actually, a “Xclick | 1,1 | #right” triggers the contextual menu of my Windows 11 main screen, not the viewport (see screenshost).

I am able to display contextual menu with a “XClick | 50,200 | #right”, 50x200 being about the absolute coords, near the topleft corner of the viewport… :

Do I miss something ?

I added a line “XDeskopAutomation | false”, but nothing changed…

The 0,0 coordinate does not work for me, too. It seems it is too close to the browser edge. But for example 10,10 works fine.

=> So this solves your question, or? If not, why not?