-1

I am trying to take a screenshot with selenium python on failure. I have written 30 tests and I want to add something in my tear down method in my base class method. How can I achieve this?

cva6
  • 325
  • 7
  • 15
  • 1
    And http://stackoverflow.com/questions/12024848/automatic-screenshots-when-test-fail-by-selenium-webdriver-in-python. – alecxe Dec 16 '15 at 00:54

1 Answers1

0

You could to a try block and call browser.get_screenshot_as_file() on failure.

Reuben L.
  • 2,806
  • 2
  • 29
  • 45