webdriverio icon indicating copy to clipboard operation
webdriverio copied to clipboard

How to select the Context Menu option when doing a rightclick

Open michaelseno opened this issue 7 years ago • 4 comments

Describe your question with as much detail as possible I am fairly new to webdriverio and I am trying to select an option on the right click menu. I am able to do the right click however when using browser.keys('ArrowDown') it doesn't seem to highlight anything in the menu. I've tried to search about this and on the forum the only way to select the context menu options are arrow buttons.

If it's about a specific piece of code, try and include some of it to support your question. below is the command I used to right click and pressing arrow down:

await this.browser.keys('Control');
await this.browser.click(element);
await this.browser.keys('Control'); // to release the control button
await this.browser.keys('ArrowDown');

It is achieving the right click but it will not select any options in the menu. I also used the key's codepoint but still the same. My original goal is to paste something whatever is in the clipboard however the browser.keys(['Meta', 'v']); is not working since I'm using chrome. so the option that I have is to right click and select option paste.

Environment (please complete the following information):

  • WebdriverIO version: 4.14.2
  • **Node.js version: 8.11.2
  • NPM version: 6.4.1
  • Browser name and version: Chrome 70.0.3538.102
  • Platform name and version: Mac OSX 10.13.6

michaelseno avatar Jan 18 '19 08:01 michaelseno

Hi @michaelseno

This is a usage question, please ask these kind of question on our Gitter channel.

Closing it here

wswebcreation avatar Jan 18 '19 09:01 wswebcreation

Describe your question with as much detail as possible I am fairly new to webdriverio and I am trying to select an option on the right click menu. I am able to do the right click however when using browser.keys('ArrowDown') it doesn't seem to highlight anything in the menu. I've tried to search about this and on the forum the only way to select the context menu options are arrow buttons.

If it's about a specific piece of code, try and include some of it to support your question. below is the command I used to right click and pressing arrow down:

await this.browser.keys('Control');
await this.browser.click(element);
await this.browser.keys('Control'); // to release the control button
await this.browser.keys('ArrowDown');

It is achieving the right click but it will not select any options in the menu. I also used the key's codepoint but still the same. My original goal is to paste something whatever is in the clipboard however the browser.keys(['Meta', 'v']); is not working since I'm using chrome. so the option that I have is to right click and select option paste.

Environment (please complete the following information):

  • WebdriverIO version: 4.14.2
  • **Node.js version: 8.11.2
  • NPM version: 6.4.1
  • Browser name and version: Chrome 70.0.3538.102
  • Platform name and version: Mac OSX 10.13.6

Hello ,have you found the solution ? i have been trying from 1 week to do this

ghost avatar Apr 23 '21 16:04 ghost

@arun-369 you can't access the browser context menu.

christian-bromann avatar Apr 24 '21 09:04 christian-bromann

Could you please let me know, How you have performed right click there?

kavita32 avatar May 23 '22 08:05 kavita32