Some links on this page are affiliate links: if you buy through them we may earn a commission, at no extra cost to you.
For an existing Protractor/Jasmine suite, the most predictable way to publish an HTML report with failure images is a two-stage pipeline: capture a PNG when Jasmine marks a spec failed, write XML results, then let an HTML reporter join the XML to those PNG files. Protractor reached end-of-life in August 2023; its project discourages new adoption and recommends migration to another end-to-end framework. Use the procedure below to maintain a legacy suite while you plan that migration.
Choose the reporting architecture first
There are two practical patterns. Do not install several reporters that all attempt to own the same Jasmine lifecycle unless you have verified their interactions.
Pattern A: explicit screenshot hook plus XML-to-HTML rendering
A Jasmine reporter captures a screenshot in specDone only when result.status === 'failed'. A separate XML reporter records test results. After the run, protractor-html-reporter-2 reads the XML and locates the PNG files using the configured browser name and paths. This split is easier to debug because capture and rendering are independent.
Pattern B: a reporter plugin that captures and renders
protractor-beautiful-reporter can be registered from onPrepare and configured with a base directory. Its takeScreenShotsOnlyForFailedSpecs option keeps images for failed specs while still listing passed tests. The project documents Jasmine 2 usage, does not support Jasmine 1, assumes one continuous result collection, and says it needs new maintainers.
#1 Best Overall
- CRISP CLARITY: This 23.8″ Philips V line monitor delivers crisp Full HD 1920x1080 visuals. Enjoy movies, shows and videos with remarkable detail
- INCREDIBLE CONTRAST: The VA panel produces brighter whites and deeper blacks. You get true-to-life images and more gradients with 16.7 million colors
- THE PERFECT VIEW: The 178/178 degree extra wide viewing angle prevents the shifting of colors when viewed from an offset angle, so you always get consistent colors
- WORK SEAMLESSLY: This sleek monitor is virtually bezel-free on three sides, so the screen looks even bigger for the viewer. This minimalistic design also allows for seamless multi-monitor setups that enhance your workflow and boost productivity
- A BETTER READING EXPERIENCE: For busy office workers, EasyRead mode provides a more paper-like experience for when viewing lengthy documents
protractor-screenshoter-plugin exposes options including screenshotPath, screenshotOnExpect, screenshotOnSpec, and writeReportFreq. Its documentation says writeReportFreq: 'asap' writes after each expectation but warns of race conditions with concurrent browsers; for CI, its README recommends the default end-of-test behavior. Validate either plugin against your exact dependency versions before standardizing it.
Pattern A: build the pipeline step by step
1. Install and pin compatible packages
Use the versions already compatible with your legacy suite, and commit the lockfile. The XML reporter is one documented way to produce the input consumed by the HTML reporter. Exact compatibility depends on your Protractor, Jasmine, Node.js, browser, driver, and reporter versions.
npm install --save-dev jasmine-reporters protractor-html-reporter-2 fs-extra
Record the runtime versions in CI logs. Protractor’s historical compatibility text should not be treated as a guarantee for current Node.js or browser releases.
The Tool Desk
Outbyte PC Repair FREEClear out junk files and repair common Windows errorsFree Scan →Outbyte Driver Updater FREEScan for outdated or missing drivers - takes under a minuteDriver Scan →2. Register a failure reporter before tests execute
Place the hook in the configuration path that runs before specs. The example below sanitizes the full spec name, creates the directory, and writes the base64 PNG returned by WebDriver. The asynchronous callback is an adaptation for readability, not a guaranteed drop-in for every Jasmine runner; confirm that your installed runner waits for asynchronous reporter methods.
const fs = require('fs-extra');
const path = require('path');
jasmine.getEnv().addReporter({
async specDone(result) {
if (result.status !== 'failed') return;
const caps = await browser.getCapabilities();
const browserName = caps.get('browserName') || 'unknown-browser';
const pngBase64 = await browser.takeScreenshot();
const safeName = result.fullName
.replace(/[^a-z0-9_-]+/gi, '_')
.replace(/^_+|_+$/g, '') || 'unnamed-spec';
const output = path.join(
'reports', 'screenshots', `${browserName}-${safeName}.png`
);
await fs.ensureDir(path.dirname(output));
await fs.writeFile(output, pngBase64, 'base64');
}
});
The screenshot is taken when the runner reports the spec as failed. That does not promise a frame captured at the exact assertion instruction: cleanup, retries, or other runner behavior may have changed the page first. Verify the timing in your suite.
3. Configure XML output
Register your chosen Jasmine XML reporter in the same pre-run configuration and write a stable file such as xmlresults.xml. Keep the XML location and report output inside the same artifact workspace so relative paths remain valid in local runs and CI.
Rank #2
- CRISP CLARITY: This 22 inch class (21.5″ viewable) Philips V line monitor delivers crisp Full HD 1920x1080 visuals. Enjoy movies, shows and videos with remarkable detail
- 100HZ FAST REFRESH RATE: 100Hz brings your favorite movies and video games to life. Stream, binge, and play effortlessly
- SMOOTH ACTION WITH ADAPTIVE-SYNC: Adaptive-Sync technology ensures fluid action sequences and rapid response time. Every frame will be rendered smoothly with crystal clarity and without stutter
- INCREDIBLE CONTRAST: The VA panel produces brighter whites and deeper blacks. You get true-to-life images and more gradients with 16.7 million colors
- THE PERFECT VIEW: The 178/178 degree extra wide viewing angle prevents the shifting of colors when viewed from an offset angle, so you always get consistent colors
const JasmineReporters = require('jasmine-reporters');
jasmine.getEnv().addReporter(new JasmineReporters.JUnitXmlReporter({
savePath: 'reports',
filePrefix: 'xmlresults',
consolidateAll: true
}));
Option names can differ by installed package release. Check the package documentation and inspect the generated XML before connecting the HTML step.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
4. Render the HTML report after Protractor exits
Run the renderer only after XML and PNG writing have completed. The browser identifier and filename convention must match what the renderer expects.
const HTMLReport = require('protractor-html-reporter-2');
const browserName = 'chrome';
const browserVersion = 'configured-in-ci';
new HTMLReport().from('reports/xmlresults.xml', {
reportTitle: 'Protractor Test Execution Report',
outputPath: './reports',
outputFilename: 'ProtractorTestReport',
screenshotPath: './reports/screenshots',
testBrowser: browserName,
browserVersion
});
Place screenshots alongside the report output as shown. If your capture hook uses a different directory or filename, change both sides together; the reporter does not discover arbitrary images automatically.
5. Publish the artifact
Configure CI to retain the entire reports directory, not only the HTML file. The HTML usually references PNGs by relative path, so uploading just the document produces broken images. Use a unique workspace per run or include a run ID in the directory when jobs can overlap.
Pattern B: configure a bundled reporter
When you prefer one package to collect results and create the report, register its Jasmine 2 adapter from onPrepare:
Do these 3 things before closing this tab:
1Clear out junk files and repair common Windows errors2Scan for outdated or missing drivers - takes under a minute3Repair Windows errors before they cause bigger problemsconst HtmlReporter = require('protractor-beautiful-reporter');
exports.config = {
onPrepare() {
jasmine.getEnv().addReporter(
new HtmlReporter({
baseDirectory: 'tmp/screenshots',
takeScreenShotsOnlyForFailedSpecs: true
}).getJasmine2Reporter()
);
}
};
Confirm the package’s output layout and whether your runner performs retries or sharding; its documented result model assumes one continuous run. If you need per-expectation images, evaluate the screenshoter plugin, but avoid ASAP report writes in concurrent multi-browser jobs unless you have demonstrated that its race behavior is acceptable.
Rank #3
- Clear visuals. Fluid motion: A 144Hz refresh rate and 1ms MPRT deliver smooth, tear‑free motion across work, gaming, and streaming for clearer, more fluid viewing.
- Eye comfort: TÜV Rheinland 3‑star* certification reduces harmful blue light while preserving stunning color quality without compromise. *TÜV Rheinland 3-star eye comfort certification.
- Wide viewing angle: Get consistent views across a wide 178° /178° viewing angle.
- In-Plane Switching (IPS): See excellent color accuracy and consistency across wide viewing angles with In-plane Switching (IPS) technology.
- Ultra-thin bezels: Maximize your viewing experience with thin bezels.
File naming, paths, and parallel execution
Make names deterministic and unique
Include browser, spec, and—when applicable—worker or shard identifiers. A sanitized full name prevents slashes, spaces, and punctuation from becoming directories or invalid filenames. Add a run ID when two CI jobs can write to a shared volume.
Resolve paths from the process working directory
Relative paths are interpreted from the directory that starts Protractor, which may differ between a developer shell and CI. Prefer an absolute artifact root derived from process.cwd(), or print the resolved paths at startup. Ensure directories exist before the browser session ends.
Control concurrency
Parallel browsers should never write the same PNG or XML file. Use separate output directories per shard, then merge artifacts in a later CI step if your report tool supports it. Avoid a plugin’s ASAP mode when simultaneous workers can update one report.
Quick wins for a faster PC:
Clear out junk files and repair common Windows errorsFree Scan →Scan for outdated or missing drivers - takes under a minuteDriver Scan →Repair Windows errors before they cause bigger problemsFix Now →Failure handling and reliability
Capture errors must not hide the test failure
Wrap screenshot capture in error handling appropriate to your policy. If a browser has already crashed, preserve the original failed result and log the capture error; do not turn a useful assertion failure into an opaque reporter exception. Decide whether a missing screenshot should fail the job separately.
Retries and late screenshots
If your runner retries a spec, use an attempt number in the filename or retain only the final attempt deliberately. Otherwise, one attempt can overwrite another and the HTML may point to an unexpected image.
Disk and retention costs
Failure-only capture sharply reduces storage compared with taking an image after every passing spec. Set CI retention according to debugging needs, and compress or expire old run directories outside the test process.
Rank #4
- CURVED FOR ENHANCED ENGAGEMENT: An immersive viewing experience with a curved monitor that wraps more closely around your field of vision; It creates a wider view, enhancing depth perception and minimizing peripheral distraction
- SMOOTH PERFORMANCE FOR SEAMLESS CONTENT: Stay in the action when playing games, watching videos, or working on creative projects; The 100Hz refresh rate reduces lag and motion blur so you don't miss a thing in fast-paced moments¹
- MORE GAMING POWER: Gain the edge with optimizable game settings; Color and image contrast can be adjusted to see scenes more vividly and spot enemies hiding in the dark; Game Mode adjusts any game to fill the screen so you can view every detail²
- KEEP IT EASY ON THE EYES: Care for your eyes and stay comfortable, even during long sessions; Advanced eye comfort technology certified by TÜV reduces eye strain by minimizing blue light and reducing irritating screen flicker²
- INCREASED VERSATILITY: Connect to more; Plug devices straight into your monitor for increased flexibility, making your computing environment even more convenient
Troubleshooting checklist
The PNG exists but the HTML shows no image
- Check that
screenshotPathpoints to the directory actually archived. - Confirm the report’s relative location and the screenshot location are consistent.
- Match
testBrowserto the browser prefix in the filename. - Compare your filename with the exact convention expected by the installed HTML reporter.
Images are written to the wrong directory
Print process.cwd() and resolve both report and screenshot paths from a known artifact root. Create directories before capture rather than assuming CI has them.
The reporter crashes or omits metadata
Check the Jasmine major version and use the package’s Jasmine 2 compatibility adapter where required. Pin Protractor, Jasmine, Node.js, browser, driver, and reporter versions as one tested set.
Parallel runs overwrite artifacts
Give every shard and browser its own directory or filename prefix. Do not use shared XML filenames, and avoid ASAP report writing where the plugin documentation warns about concurrent races.
CI fails while local runs pass
Compare working directories, environment variables, browser headless flags, driver versions, and dependency lockfiles. Exercise the complete reporting lifecycle in the same CI mode used for production runs.
The screenshot shows a later state
specDone timing is runner-dependent and is not documented as an exact assertion-time capture. Add logging around teardown and verify the visual state in your own suite before relying on the image for pixel-level diagnosis.
Crashes, No Sound, or Screen Glitches?
Random freezes, missing sound and display glitches usually trace back to one bad driver. Find and replace yours safely.Free scan · under a minutePC Slower Than It Used to Be?
A free scan shows the junk files, broken settings and background clutter dragging Windows down - then fixes them in one click.Free scan · Windows 10 & 11Testing the reporting pipeline itself
- Create one deliberately failing spec and verify that a PNG and XML entry appear.
- Open the HTML locally with its screenshots directory beside it.
- Run a passing-only batch and confirm the report remains valid without failure images.
- Run two browsers and two shards concurrently to check for collisions.
- Delete the output directory before each run so stale images cannot make a broken configuration look healthy.
- Archive the exact report directory and inspect it on a clean machine or CI artifact viewer.
Or skip the browser setup
If your goal is to capture a page outside the Protractor run—for example, a deployment preview or a diagnostic URL—ScreenshotNeo provides a single HTTP request. It accepts consent banners before capture and removes more than 60 known consent platforms, newsletter popups, and chat widgets; each step can be disabled. Bot checks or CAPTCHAs, blank pages, timeouts, failed loads, and cache hits are not billed, and response headers identify the page verdict and billing status. Its MCP server exposes take_screenshot, get_page_info, and capture_pdf to Claude, Cursor, and other MCP clients.
Use the API documentation at https://screenshotneo.com/docs/ for authentication and options. A minimal call is:
Best Value
- 【INTEGRATED SPEAKERS】Whether you're at work or in the midst of an intense gaming session, our built-in speakers provide rich and seamless audio, all while keeping your desk clutter-free.
- 【EASY ON THE EYES】 Protect your eyes and enhance your comfort with Blue-Light Shift technology. This feature reduces harmful blue light emissions from your screen, helping to alleviate eye strain during long hours of use and promoting healthier viewing habits.
- 【WIDEN YOUR PERSPECTIVE】Our sleek minimal bezel design ensures undivided attention. The nearly bezel-free display seamlessly connects in a dual monitor arrangement, delivering an unobstructed view that lets you focus on more at once, completely distraction-free.
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp
Python:
import requests
r = requests.get(
"https://api.screenshotneo.com/v1/shot",
params={"access_key": "YOUR_API_KEY", "url": "https://stripe.com"},
timeout=90,
)
r.raise_for_status()
open("shot.webp", "wb").write(r.content)
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}`);
if (!res.ok) throw new Error(`Screenshot failed: ${res.status}`);
const fs = await import('node:fs/promises');
await fs.writeFile('shot.webp', Buffer.from(await res.arrayBuffer()));
Beyond basic capture, ScreenshotNeo supports full-page lazy-image loading, CSS-selector element capture, dark mode, 12 device presets or custom viewports, retina scale, PDF paper and page-range controls, HTML/CSS input, custom JavaScript and CSS, clicks, selector waits, delays, network-idle waits, ad/tracker/request blocking, headers, cookies, user agents, authorization, timezone, geolocation, transparent backgrounds, resizing, chosen cache TTLs, signed image links, asynchronous jobs with signed webhooks, bulk capture for up to 100 URLs per call, usage data, an OpenAPI specification, and familiar parameter names for easier switching.
Every feature is available on every plan: 1,000 shots monthly free without a card; Starter is $5 for 3,000; Growth $15 for 15,000; Pro $39 for 60,000; Scale $99 for 250,000; and Business $249 for 1,000,000. Yearly billing provides two months free. Create a free ScreenshotNeo account to start with the 1,000 no-card shots.
Frequently Asked Questions
Can I use this setup for a new Protractor project?
No. Protractor is end-of-life, so this workflow is intended for maintaining an existing suite while you migrate to a supported end-to-end tool.
Why does the HTML reporter need the browser name?
The documented XML-to-HTML flow uses the browser identifier to match report entries with previously captured screenshot filenames.
Should I capture screenshots after every expectation?
Only if the additional artifacts and concurrency risk are justified. Failure-only capture is smaller; ASAP writing can race when browsers run concurrently.
What should be archived in CI?
Archive the HTML report, its screenshot directory, and the XML results together so relative image references remain valid.
Free tools Windows power users keep installed
One-click scans. No signup required.
Quick Recap
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.

