如何在python selenium中双击div?
在behave步骤实现中,我希望使用webdriver双击一个div。然而,我无法实现这一点。我的代码:如何在python selenium中双击div?,python,selenium,webdriver,bdd,chrome-web-driver,Python,Selenium,Webdriver,Bdd,Chrome Web Driver,在behave步骤实现中,我希望使用webdriver双击一个div。然而,我无法实现这一点。我的代码: @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_select
@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()
我也试过了
@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()
find\u element\u by_css\u选择器
按预期返回一个WebElement
。但是,双击
javascript操作从未执行过-应该出现一个新的div-在场景步骤中无声地失败。它在双击调用的末尾?哎呀,没有看到…可能是重复的