Search code examples
testingautomated-testsselenium-idee2e-testingtestcafe

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


Solution

  • 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})