可以在basepage类中定义独立的方法: def mouse_move_to_ele(self, loc, xoffset, yoffset): ActionChains(self.driver).move_to_element(self.locator(loc)).move_by_offset(xoffset, yoffset).release().click().perform()
xoffset,yoffset相当于图片中心点的X和Y轴的偏移量
可以在basepage类中定义独立的方法: def mouse_move_to_ele(self, loc, xoffset, yoffset): ActionChains(self.driver).move_to_element(self.locator(loc)).move_by_offset(xoffset, yoffset).release().click().perform()
xoffset,yoffset相当于图片中心点的X和Y轴的偏移量