Take the 2-minute tour ×
Software Quality Assurance & Testing Stack Exchange is a question and answer site for software quality control experts, automation engineers, and software testers. It's 100% free, no registration required.

I am using python selenium bindings for phantomjs. I am trying to simulate a right click and then take a screenshot (showing the context menu). But I am unable to get the right click context menu.

Here is my code

from selenium import webdriver
import time

browser = webdriver.PhantomJS()
browser.implicitly_wait(30)
browser.get('http://google.co.in')
ac = webdriver.ActionChains(browser)

# select the input text field on google
e_input = browser.find_element_by_css_selector('#gbqfq')
ac.context_click(e_input)
ac.perform()

time.sleep(2)
browser.save_screenshot('google_right_click.png')
browser.quit()
share|improve this question

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.