def _reconcile_drag_preshot(self):
ofxdiv = self.browser.find_element_by_id('ofx-2-0')
logger.info('ofxdiv location: %s size: %s',
ofxdiv.location, ofxdiv.size)
pos_x = (ofxdiv.location['x'] - 400) + (ofxdiv.size['width'] / 4)
pos_y = (ofxdiv.location['y'] - 50) + (ofxdiv.size['height'] / 2)
self.browser.execute_script(
"$('body').append($('%s'));" % self._cursor_script(pos_x, pos_y)
)
actions = ActionChains(self.browser)
actions.move_to_element(ofxdiv)
actions.click_and_hold()
actions.move_by_offset(-400, -50)
actions.perform()
self.browser.get_screenshot_as_file('docs/source/foo.png')
评论列表
文章目录