Selenium / Quiz

Screenshots & Listeners: Evidence Collection

A failed test without a screenshot is a rumor. Wire up TakesScreenshot, element shots, and Selenium 4 listeners so every failure leaves forensics behind.

Difficulty
Easy
Format
Quiz
Points
100
Estimate
9 min

// MISSION BRIEF

Your Mission

Your nightly suite fails 14 tests and the only evidence is a stack trace. Management wants pictures. You are wiring evidence capture into the framework tonight.

Six questions on screenshot APIs and Selenium 4's listener mechanism. Speed bonus active.

// FIRST CONTACT

Battle teaser

The standard Java call to capture a screenshot as a file:

  1. A((TakesScreenshot) driver).getScreenshotAs(OutputType.FILE)
  2. Bdriver.manage().captureScreen()
  3. Cdriver.screenshot("fail.png")
  4. Dnew Screenshot(driver).save()
Answers, scoring, hints, and the full battle stay sealed.

// SKILL TAGS

seleniumscreenshotslistenersjavareporting