Skip to content

Commit 09ff359

Browse files
committed
Better handling of failure screenshots for logs
1 parent 11802db commit 09ff359

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

seleniumbase/core/log_helper.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,10 @@
1010
def log_screenshot(test_logpath, driver):
1111
screenshot_name = settings.SCREENSHOT_NAME
1212
screenshot_path = "%s/%s" % (test_logpath, screenshot_name)
13-
driver.get_screenshot_as_file(screenshot_path)
13+
try:
14+
driver.get_screenshot_as_file(screenshot_path)
15+
except Exception:
16+
print("WARNING: Unable to get screenshot for failure logs!")
1417

1518

1619
def log_test_failure_data(test, test_logpath, driver, browser):

0 commit comments

Comments
 (0)