0

Webdriverio 6 - How to rightclick at X and Y location.

Could not find the rightclick command in WebdriverIO version 6 docs.

this is the code showing in WebdrivewrIO v4 but not working in V6

 browser.rightClick(elementXpath,5,184); 

Error showign is

rightClick is not a function

Is there a way to right click in WebdriverIO V6. Please help.

Sam_
  • 31
  • 7

2 Answers2

1

The best option is to start with reading docs, in this case see click command usage https://webdriver.io/docs/api/element/click.html#usage

According to the docs you can pass x, y, and button.

Mike G.
  • 3,860
  • 3
  • 17
  • 18
0

In API v6 you can pass the button you want to click (left||right||middle). For your use case above it would look like the following.

$(selector).click({ "right", 5, 184 })

Their v6 API docs can be found here: https://v6.webdriver.io/docs/api.html

JCrooks
  • 113
  • 1
  • 6