I want to automatic capturing screenshots if my webdriver tests failed (any exception or assertion error). I am using Python unittest and Selenium Webdriver. Does anyone hav
For me help this solution:
def teardown_method(self, method): """Driver elimination""" if sys.exc_info(): allure.attach('screenshot', self.driver.get_screenshot_as_png(), type=AttachmentType.PNG) self.driver.quit() pass