Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

For JBehave’s WebDriver integration, instantiate WebDriverScreenshotOnFailure with the same WebDriverProvider that creates and manages your test browser, then register that instance in the InstanceStepsFactory. Passing the configured StoryReporterBuilder is the pattern shown in JBehave’s WebDriver guide. The hook captures failed scenario outcomes (including scenario examples), provided that the concrete WebDriver implementation supports screenshots.

What the failure hook does

WebDriverScreenshotOnFailure is a WebDriver-steps class that saves a screenshot when a scenario outcome fails. It is a JBehave steps object, so adding it to your steps factory is what activates the failure callbacks. It is not enabled merely by turning on HTML, XML, TXT, or console reporting.

The hook has constructors for three common arrangements:

  • A provider-only constructor, when the hook can use default reporting and path behavior.
  • A provider plus StoryReporterBuilder, which is the form used by the official WebDriver example.
  • A provider, reporter builder, and custom screenshot path pattern, when the default destination does not fit your build.

JBehave also cautions that not every WebDriver implementation supports screenshot capture. A real browser driver or remote implementation must expose the required screenshot capability at the moment the failure hook runs.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
#1 Best Overall
Sale
Seagate 2TB Portable Hard Drive | USB 3.0 (STGX2000400)
  • Easily store and access 2TB to content on the go with the Seagate Portable Drive, a USB external hard drive
  • Designed to work with Windows or Mac computers, this external hard drive makes backup a snap just drag and drop
  • To get set up, connect the portable hard drive to a computer for automatic recognition no software required
  • This USB drive provides plug and play simplicity with the included 18 inch USB 3.0 cable
  • The available storage capacity may vary.

Configure JBehave step by step

1. Keep one provider for the whole WebDriver setup

Use the same provider instance for page objects, lifecycle steps, and the screenshot hook. Creating a second provider can leave the hook looking at a different driver—or at no active driver—when the scenario fails.

private final WebDriverProvider driverProvider = new MyWebDriverProvider();

MyWebDriverProvider represents the provider already used by your application steps. Do not replace it with a newly constructed provider just for screenshots.

2. Build a Selenium configuration and reporter

Configure JBehave with SeleniumConfiguration, supplying the provider and your reporter builder. The reporter controls report formats and failure traces independently of the screenshot hook. A project may emit console, TXT, HTML, and XML reports and may enable or compress failure traces without changing how screenshots are registered.

protected Configuration configuration() {
    return new SeleniumConfiguration()
        .useWebDriverProvider(driverProvider)
        .useStoryReporterBuilder(new StoryReporterBuilder()
            .withCodeLocation(codeLocationFromClass(this.getClass()))
            .withDefaultFormats()
            .withFailureTrace(true)
            .withFailureTraceCompression(true));
}

The exact reporter methods available depend on the JBehave artifact in your project. Keep your existing report configuration if it already works; adding a screenshot hook does not require switching report formats.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

3. Register the hook in stepsFactory()

Return an InstanceStepsFactory containing your application steps, lifecycle steps, and the failure hook. The important detail is that the hook receives the same provider and the reporter builder from the active configuration.

@Override
public InjectableStepsFactory stepsFactory() {
    Configuration configuration = configuration();

    return new InstanceStepsFactory(
        configuration,
        new ApplicationSteps(),
        lifecycleSteps,
        new WebDriverScreenshotOnFailure(
            driverProvider,
            configuration.storyReporterBuilder()));
}

Replace ApplicationSteps and lifecycleSteps with your project’s classes. In a typical configuration class, the relevant imports are the JBehave core configuration and steps types, SeleniumConfiguration, WebDriverProvider, and WebDriverScreenshotOnFailure from the WebDriver integration artifact. Package names can differ between JBehave artifacts, so let your IDE resolve them against the dependency actually used by the build.

Rank #2
Seagate Portable 1TB External Hard Drive HDD – USB 3.0 for PC, Mac, PlayStation, & Xbox, 1-Year Rescue Service (STGX1000400) , Black
  • Easily store and access 1TB to content on the go with the Seagate Portable Drive, a USB external hard drive.Specific uses: Personal
  • Designed to work with Windows or Mac computers, this external hard drive makes backup a snap just drag and drop. Reformatting may be required for Mac
  • To get set up, connect the portable hard drive to a computer for automatic recognition no software required
  • This USB drive provides plug and play simplicity with the included 18 inch USB 3.0 cable
  • The available storage capacity may vary.

4. Choose the WebDriver lifecycle deliberately

The WebDriver guide demonstrates both PerStoriesWebDriverSteps and PerStoryWebDriverSteps. Select the lifecycle that matches how your stories and scenarios are scheduled.

  • Per story: the browser lifecycle is tied to an individual story.
  • Per stories: one lifecycle can span multiple stories. The guide notes that this arrangement requires a same-thread executor.

If scenarios run in parallel, confirm that the provider, lifecycle object, and executor keep the failing scenario associated with the correct active driver. A screenshot taken from another thread or another scenario is a lifecycle problem, not a reporter-format problem.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

5. Set a custom screenshot path when needed

Use the three-argument constructor when your CI system expects screenshots in a particular directory or naming pattern:

new WebDriverScreenshotOnFailure(
    driverProvider,
    configuration.storyReporterBuilder(),
    screenshotPathPattern)

The API exposes a default-pattern constant, but its literal value is not established consistently across the available documentation. Check the constant or source in the exact JBehave dependency resolved by your build instead of guessing the default. Make sure the destination directory exists and that the test process has write permission.

6. Verify screenshot capability before relying on failures

Run a deliberately failing scenario in the same browser and execution mode used by CI. Confirm that:

  • the provider returns the active driver while the failure callback executes;
  • the concrete driver implements screenshot capture, including when the browser is remote;
  • the configured path is writable;
  • your build artifact collector includes that path; and
  • the report output identifies the failed scenario so you can match it to the image.

JBehave’s warning is broad: not all WebDriver implementations support screenshots. A passing local check with one driver does not prove that a different remote driver or browser mode has the same capability.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #3
UnionSine 1TB Ultra Slim Portable External Hard Drive HDD-USB 3.0
  • 【Upgraded version】 - The mirror logo strip is combined with the striped non-slip design. The rounded corners of the shell are more suitable for holding. The strips play a heat dissipation function to ensure a stable and fast transmission process.
  • 【Ultra-thin and quiet】 - The motherboard adopts JMicron 578 noise-free solution, giving you a quiet working environment. Lightweight and portable size designed to fit in your pocket for easy portability.
  • 【Ultra-Fast Data Transfers】 - Pairing this external hard drive with JMicron 578 solution USB 3.0 and USB 2.0 interfaces enables blazing-fast data transfer. It boasts theoretical read speeds of up to 125MB/s and write speeds of up to 103MB/s.
  • 【Plug and Play】 - With no software to install, just plug it in and the drive is ready to use.The hard disk chip is wrapped with an aluminum anti-interference layer to increase heat dissipation and protect data.
  • 【What You Get】 - 1 x Portable Hard Drive, 1 x USB 3.0 Cable, 1 x User Manual, Gift-type shell packaging ,Three-year manufacturer's warranty and free technical support services.

Complete configuration example

The following example shows the registration point in a configuration class. It intentionally leaves application-specific provider, page, and lifecycle classes as project types.

public class AcceptanceTestConfiguration extends JUnitStories {

    private final WebDriverProvider driverProvider = new MyWebDriverProvider();
    private final WebDriverSteps lifecycleSteps =
        new PerStoryWebDriverSteps(driverProvider);

    @Override
    public Configuration configuration() {
        return new SeleniumConfiguration()
            .useWebDriverProvider(driverProvider)
            .useStoryReporterBuilder(
                new StoryReporterBuilder()
                    .withCodeLocation(codeLocationFromClass(
                        this.getClass()))
                    .withDefaultFormats()
                    .withFailureTrace(true)
                    .withFailureTraceCompression(true));
    }

    @Override
    public InjectableStepsFactory stepsFactory() {
        Configuration configuration = configuration();
        return new InstanceStepsFactory(
            configuration,
            new ApplicationSteps(),
            lifecycleSteps,
            new WebDriverScreenshotOnFailure(
                driverProvider,
                configuration.storyReporterBuilder()));
    }
}

This is an adaptation of the official structure rather than a drop-in project: your JBehave runner base class, provider implementation, lifecycle constructor, and report methods may differ. Preserve the central relationship—one provider shared by the lifecycle and WebDriverScreenshotOnFailure.

WebDriver API versus the legacy Selenium API

JBehave documents two separate integration choices. Use WebDriverScreenshotOnFailure when the project is built around the WebDriver provider API. A separate SeleniumScreenshotOnFailure hook exists for the Selenium API.

Choice Use when Argument style
WebDriverScreenshotOnFailure Your setup uses WebDriverProvider and SeleniumConfiguration. Pass the provider, optionally the reporter builder and path pattern.
SeleniumScreenshotOnFailure Your project uses JBehave’s separate Selenium integration. Pass the Selenium integration object required by that API.

Do not pass a Selenium object to the WebDriver-provider constructor, or assume that registering both hooks is necessary. Pick the hook that matches the integration already used by the test suite.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Reporting, paths, and build artifacts

Reporting is a separate concern

StoryReporterBuilder determines report formats and failure-trace behavior. The screenshot hook is registered as steps. The available documentation does not establish that HTML reporting is required for the hook to save an image, so do not add HTML solely for that reason.

Make paths predictable in CI

Use a custom path pattern if local defaults put files outside the directory collected by your CI system. Keep the pattern stable across retries and parallel workers, and include enough scenario or story context to identify the failing execution. Because the literal default pattern is version-dependent or otherwise not established here, inspect the exact API source before building tooling around it.

Rank #4
Sale
WD 2TB Elements Portable External Hard Drive for Windows, USB 3.2 Gen 1/USB 3.0 for PC & Mac, Plug and Play Ready - WDBU6Y0020BBK-WESN
  • High capacity in a small enclosure – The small, lightweight design offers up to 6TB* capacity, making WD Elements portable hard drives the ideal companion for consumers on the go.
  • Plug-and-play expandability
  • Vast capacities up to 6TB[1] to store your photos, videos, music, important documents and more
  • SuperSpeed USB 3.2 Gen 1 (5Gbps)

Account for retries

JBehave release notes mention screenshot-saving retry and logging work under JBEHAVE-603, the original screenshot-on-failing-scenario feature under JBEHAVE-382, and a cross-platform path fix under JBEHAVE-752. The available release-note material does not provide exact artifact-version boundaries for those changes. Verify the behavior against the dependency version resolved by your project rather than inferring a minimum version from the issue numbers.

Troubleshooting missing screenshots

The scenario fails but no image is created

  • Cause: The hook was never registered. Fix: Confirm that stepsFactory() returns WebDriverScreenshotOnFailure alongside application and lifecycle steps.
  • Cause: The hook received a different provider. Fix: Pass the exact provider used to create the browser and lifecycle steps.
  • Cause: The driver lacks screenshot support. Fix: Check the concrete local or remote implementation and run a capability check with that same driver.

The hook runs, but the file is elsewhere

Inspect the effective default path in the exact JBehave dependency, or use the constructor with an explicit path pattern. Then verify directory creation, write permissions, and CI artifact collection.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Only some browsers produce screenshots

This usually indicates a capability difference between driver implementations or execution modes. Compare the failing browser’s screenshot support with the browser that succeeds; do not assume that a WebDriver-compatible session automatically supports image capture.

Parallel scenarios produce confusing or mismatched images

Review the lifecycle and executor configuration. The per-stories example requires a same-thread executor, and any parallel arrangement must preserve the association between a failing scenario and its active provider. Temporarily run the story serially to distinguish a lifecycle issue from a driver-capability issue.

Changing report formats did not help

Report formats do not activate the hook. Leave StoryReporterBuilder focused on reports and traces, and debug registration, provider identity, driver capability, and output permissions separately.

A custom path pattern fails on one operating system

Check path separators and the parent directory created by the build. The release notes mention a cross-platform path fix, but do not establish which dependency version contains it; verify your resolved version and test the pattern on every supported runner.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Best Value
Kosbees 500 GB External Hard Drives,Portable Hard Drive for Windows,Ultra Slim External HDD Store Compatible with PC, MAC,Laptop,PS4, Xbox one, Xbox 360;Plug and Play Ready
  • 【Plug-and-Play Expandability】 With no software to install, just plug it in and the drive is ready to use in Windows(For Mac,first format the drive and select the ExFat format.
  • 【Fast Data Transfers 】The external hard drives with the USB 3.0 cable to provide super fast transfer speed. The theoretical read speed is as high as 110MB/s-133MB/s, and the write speed is as high as 103MB/s.
  • 【High capacity in a small enclosure 】The small, lightweight design offers up to 500GB capacity, offering ample space for storing large files, multimedia content, and backups with ease. Weighing only 0.35 Lbs, it's easy to carry "
  • 【Wide Compatibility】Supports PS4 5/xbox one/Windows/Linux/Mac and other operating systems, ensuring seamless integration with game consoles,various laptops and desktops .
  • Important Notes for PS/Xbox Gaming Devices: You can play last-gen games (PS4 / Xbox One) directly from an external hard drive. However, to play current-gen games (PS5 / Xbox Series X|S), you must copy them to the console's internal SSD first. The external drive is great for keeping your library on hand, but it can't run the new games.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Or skip the browser setup

If you need a URL-level screenshot rather than a capture from the exact WebDriver session running a JBehave scenario, ScreenshotNeo provides a single HTTP endpoint. It is the first alternative to try when you want clean shots: it accepts consent banners like a visitor and removes more than 60 known consent platforms, newsletter popups, and chat widgets before capture; only clean shots are billed, while bot checks, blank pages, timeouts, failed loads, and cache hits are not billed. Responses identify the result with X-Page-Verdict and X-Billed headers. Its MCP server gives Claude, Cursor, and other MCP clients take_screenshot, get_page_info, and capture_pdf tools.

See the ScreenshotNeo documentation for request options and authentication. A cURL request is:

curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp

The same request in Python:

import requests
r = requests.get(
    "https://api.screenshotneo.com/v1/shot",
    params={"access_key": "YOUR_API_KEY", "url": "https://stripe.com"},
    timeout=90)
open("shot.webp", "wb").write(r.content)

And in Node.js:

const q = new URLSearchParams({ access_key: 'YOUR_API_KEY', url: 'https://stripe.com' });
const res = await fetch(`https://api.screenshotneo.com/v1/shot?${q}`);

ScreenshotNeo supports PNG, JPEG, WebP, and PDF output plus full-page captures with lazy images loaded, CSS-selector element captures, dark mode, device presets, arbitrary viewports, retina scale, PDF paper and page controls, custom CSS and JavaScript, pre-capture clicks, selector or network-idle waits, request blocking, custom headers and cookies, user-agent and authorization values, timezone and geolocation, transparent backgrounds, resizing, selectable-TTL caching, signed public image links, asynchronous jobs with signed webhooks, bulk capture for up to 100 URLs per call, a usage API, and an OpenAPI specification. Parameter names used by other screenshot APIs also work, which can simplify migration.

Plan Included screenshots Price
Free 1,000 per month $0, no card
Starter 3,000 $5
Growth 15,000 $15
Pro 60,000 $39
Scale 250,000 $99
Business 1,000,000 $249

Yearly billing provides two months free, and every feature is available on every plan. Create a free ScreenshotNeo account to get 1,000 screenshots each month with no card required; paid plans start at $5 for 3,000 screenshots.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Practical validation checklist

  1. Run one intentionally failing scenario.
  2. Confirm the same provider instance is used by pages, lifecycle steps, and the hook.
  3. Verify the driver implementation supports screenshots.
  4. Locate the generated file and check its readability.
  5. Run the test through the CI executor and collect the configured directory.
  6. If scenarios are parallel, verify lifecycle and executor behavior before enabling screenshot assertions in the full suite.

Frequently Asked Questions

Do JBEHAVE-603, JBEHAVE-382, or JBEHAVE-752 identify a required JBehave version?

No exact artifact-version boundaries are established by the available release-note material. Check the Javadocs and source for the dependency version resolved by your build before relying on a constructor, retry behavior, or path fix.

Can ScreenshotNeo capture the exact browser state from a failed JBehave session?

No. ScreenshotNeo captures a URL through its own request, while WebDriverScreenshotOnFailure captures the active test browser. Use the JBehave hook when session state matters; use ScreenshotNeo when a clean URL capture or API workflow is the goal.

Quick Recap

SaleBestseller No. 1
Seagate 2TB Portable Hard Drive | USB 3.0 (STGX2000400)
Seagate 2TB Portable Hard Drive | USB 3.0 (STGX2000400)
This USB drive provides plug and play simplicity with the included 18 inch USB 3.0 cable; The available storage capacity may vary.
$119.99
Bestseller No. 2
Seagate Portable 1TB External Hard Drive HDD – USB 3.0 for PC, Mac, PlayStation, & Xbox, 1-Year Rescue Service (STGX1000400) , Black
Seagate Portable 1TB External Hard Drive HDD – USB 3.0 for PC, Mac, PlayStation, & Xbox, 1-Year Rescue Service (STGX1000400) , Black
This USB drive provides plug and play simplicity with the included 18 inch USB 3.0 cable; The available storage capacity may vary.
$119.80
SaleBestseller No. 4

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.