In a behave step implementation I wish to double click a div using webdriver. However I cannot get this to occur. My code:
@when('i double click on the element "{text}"')
def step_impl(context, text):
action = webdriver.ActionChains(context.browser)
action.double_click(context.browser.find_element_by_css_selector(text)).perform()
I have also tried
@when('i double click on the element "{text}"')
def step_impl(context, text):
action = webdriver.ActionChains(context.browser)
el = context.browser.find_element_by_css_selector(text)
action.move_to_element_with_offset(el, 10, 10).double_click()
action.perform()
the find_element_by_css_selector
returns a WebElement
as expected. But the double_click
javascript action is never performed - a new div should appear - failing silently in the scenario steps.