Quantcast
Channel: Active questions tagged selenium - Stack Overflow
Viewing all articles
Browse latest Browse all 99014

How to selecting option from right click menu with Selenium

$
0
0

I'm using chrome as the driver and after double-clicking/context-clicking, the prompt window opens but the driver won't switch to the prompt window. Here is what I have tried... The page I am opening is google.com, search, then trying to right-click so i can open the results in different tabs. Thanks in advance.

.......
element = driver.find_element_by_class_name("LC20lb")
actionchains = ActionChains(driver)
actionchains.context_click(element).perform()
# Driver needs to switch to the popup from here before it can press the down arrow.
sleep(5)
actionchains.send_keys(Keys.ARROW_DOWN).perform()
sleep(4)
driver.quit()

Viewing all articles
Browse latest Browse all 99014

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>