Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Click an area of a webpage given an X Y value

I am trying to click a pin I have on my application which uses Bing Maps V8. The pins which are placed on to the map do not appear in the DOM elements as they are directly rendered onto the Map by Bing Maps engine.

I was wondering is there a way I can tell Testcafe to click an X Y value - for example

testController.click(718,962);

The above X Y value is from Selenium's IDE test recorder

Many thanks for any help

like image 739
Luke Halley Avatar asked Oct 13 '25 00:10

Luke Halley


1 Answers

Please use the Click action with offset to click a point on an area. For example:

t.click('body', { offsetX: X, offsetY: Y })
// or t.click('img', {offsetX: X, offsetY: Y})
like image 83
Marion Avatar answered Oct 15 '25 13:10

Marion