How to click on a context menu- popup menu

44 views
Skip to first unread message

Venu

unread,
May 3, 2016, 8:07:50 AM5/3/16
to Selenium Users

I need to do the following

1)Right click on a element

2) Context menu is displayed

3) On moving to a specific menu (move_to_element) in context menu - pops up
another menu say MenuX

4) Need to click on MenuX

I am able to do steps 1 to 3 but not 4. When I checked is_displayed for MenuX it returns False

When I try driver.find_element_by_xpath("html/body/div[5]/span[2]") it works (I do not want to hardcode)

But not with id of menu.

I also tried driver.find_element_by_css_selector("div#contextMenu_Div #menuX") and it didnt work

menuX is not link but a span element. Any suggestions

Venu

unread,
May 3, 2016, 8:51:05 AM5/3/16
to Selenium Users
Also tried but no luck
actions = ActionChains(driver)
actions.move_to_element(menu)
actions.click(hidden_submenu)
actions.perform() 

anemuday

unread,
May 3, 2016, 8:53:23 AM5/3/16
to Selenium Users
Hi Venu,

Right click can be performed using Actions class.

Please below video may help you.

Thanks,
Uday



On Tuesday, 3 May 2016 17:37:50 UTC+5:30, Venu wrote:

Andreas Tolfsen

unread,
May 3, 2016, 11:11:33 AM5/3/16
to seleniu...@googlegroups.com
Tue, 3 May 2016 05:07:50 -0700 (PDT) Venu <venu....@gmail.com>:
> down votefavorite
> <http://stackoverflow.com/questions/37002833/how-to-click-on-a-context-menu-popup-menu#>

Generally speaking, interacting with browser chrome UI is outside the
scope of WebDriver.

(Please also don’t cross-post between webdriver@ and selenium-users@,
which reminds me that at least one of these lists is probably
unnecessary by this point and should be shut down.)
Reply all
Reply to author
Forward
0 new messages