7. Navigation, Window Management & Screenshots

Navigation and Screenshots

driver.maximize_window()
driver.get("https://targetqa.com")

# History navigation:
driver.back()
driver.forward()
driver.refresh()

# Capture screenshot on failure:
driver.save_screenshot("test-results/failure.png")

Task

  • Implement format_screenshot_name:
  • 1. Accept test_name string.
  • 2. Return f"screenshots/{test_name}.png".
💡Common doubts
Did you like the problem?
Lesson 7 of 16
Python
Loading code editor…
Next