selenium python驱动程序,函数:使用\u偏移量将\u移动到\u元素\u不正确的行为

selenium python驱动程序,函数:使用\u偏移量将\u移动到\u元素\u不正确的行为,python,selenium,Python,Selenium,我面临SeleniumPython驱动程序的问题,函数:使用\u偏移将\u移动到\u元素 该函数似乎只将鼠标移动到元素的中间 def setUp(self): print "hello" self.logger = setuplogging() self.browser = webdriver.Firefox() def _test_add_point(self): body = self.browser.find_element_by_tag_name("

我面临SeleniumPython驱动程序的问题,函数:使用\u偏移将\u移动到\u元素 该函数似乎只将鼠标移动到元素的中间

def setUp(self):

    print "hello"
    self.logger = setuplogging()
    self.browser = webdriver.Firefox()

def _test_add_point(self):

    body = self.browser.find_element_by_tag_name("body")

    body.send_keys(Keys.UP * 20)
    applet = self.browser.find_element_by_id("selected-applet")
    pics = applet.find_elements_by_xpath(".//div[contains(@class, 'picture')]")

    time.sleep(5)
    real_pic = pics[0].find_elements_by_xpath(".//img")
    action_chains = ActionChains(self.browser)


    action_chains.move_to_element_with_offset(real_pic[0], 20, 20).perform()
    time.sleep(5)
    action_chains.click().perform()
    time.sleep(10)
当我执行上面的代码时,它将始终单击图片的中间,而我的期望是在这种情况下它将单击到中心加上偏移(20,20)。更改偏移量没有帮助。使用函数move_by_offset也没有帮助


您能帮忙吗?

根据我使用画布使用偏移量将元素移动到元素的经验,它可以正常工作。你为什么说它会点击中心?它可能是在生成事件时填充该特定对象的x、y值的浏览器。