deftest_screenshot(self):# make screenshot and get is as base64
screenshot=self.driver.get_screenshot_as_base64()self.assertTrue(screenshot)# make screenshot and save it to the local filesystem
success=self.driver.get_screenshot_as_file("foo.png")self.assertTrue(success)self.assertTrue(os.path.isfile("foo.png"))# get rid of the file
os.remove("foo.png")