Selenium:Chrome driver(NodeJS APP): right-click and select any option

42 views
Skip to first unread message

Uttam verma

unread,
Jun 7, 2016, 7:30:32 AM6/7/16
to Selenium Users
I am automating right-click and select menu options feature on a application (node.js).
Right-click is successful(as shown in attached image) but not able to select any options from menu. We also tried keyboard Up and down operations using ActionChains module with no success.
I am using chromedriver for nodejs.

Selenium Version : 2.53.2

Code to right-click and select 3rd option:

from selenium import webdriver
from selenium.webdriver.common.action_chains import ActionChains

self._browser = webdriver.Chrome("C:\\NodeWebKit\\chromedriver.exe")
# Identifying the user
user = self._browser.find_element_by_xpath("//div[@class='first-name' and contains(text(), 'AUSER_189527')]")
# selecting the user by clicking on it
user.click()
# right-click and select 3rd option
ActionChains(self._browser).context_click(user).send_keys(Keys.ARROW_DOWN).
send_keys(Keys.ARROW_DOWN).send_keys(Keys.ARROW_DOWN).send_keys(Keys.RETURN).perform()
right-click.png
Reply all
Reply to author
Forward
0 new messages