def screen_shot(self, caseName): screen_shot_time = time.strftime('%H%M%S', time.localtime()) screen_shot_name = caseName + "_" + screen_shot_time + ".png" screen_shot_fullname = os.path.join(log_dir, screen_shot_name) self.driver.get_screenshot_as_file(screen_shot_fullname) LOG.error("【异常】<a href='%s'>截图</a>" % screen_shot_fullname)
def get_screenshot(self, file_path): try: self.driver.get_screenshot_as_file(file_path) LOG.info("【截图】%s" % file_path) except Exception as msg: LOG.error("【截图】%s" % msg)