October DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsSlow PC?RecommendedPC slow today? Run a repair scan before it gets worseResolve common Windows issues and optimize system performance.Scan NowOctober DealsAmazon USDeal season is back - check today's better picksAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
World desk7 min

How to Run Visual Tests with WebdriverIO

A practical guide to WebdriverIO visual tests: configure the visual service, create and review baselines, choose screenshot scope, and keep comparisons stable.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Install @wdio/visual-service, register it in your WebdriverIO configuration, and call a check method such as browser.checkScreen('home'). The first check can create a baseline automatically; later runs compare new screenshots against it and produce diffs to review. Reliable results depend on keeping the browser, platform, device, and page state consistent between runs.

Install and configure the visual service

From your WebdriverIO project, install the service as a development dependency:

npm install --save-dev @wdio/visual-service

Register visual in the services array of your WebdriverIO configuration. This example sets baseline and screenshot folders and includes browser and viewport details in image names:

// wdio.conf.js
export const config = {
  // Keep your existing runner, specs, capabilities, and other settings.
  services: [
    ['visual', {
      baselineFolder: './visual-baselines',
      screenshotPath: './visual-screenshots',
      savePerInstance: true,
      formatImageName: '{tag}-{browserName}-{width}x{height}'
    }]
  ]
};

Merge these options into your existing configuration rather than replacing its other settings. The service works with WebdriverIO-supported frameworks including Mocha, Jasmine, and CucumberJS. It adds screenshot save and check commands, along with visual snapshot matchers. See the WebdriverIO visual testing guide and service options for the current configuration details.

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
Elebase USB to USB C Adapter for iPhone 18 Pro Max,USBC Car Charger Adapter
  • Read Before You Buy — No Video Output: These adapters support charging and USB 2.0 data transfer, but cannot transmit video signals. Except for standard USB webcams (which use USB data only), they are not compatible with HDMI/DisplayPort cables, video-capable USB-C hubs, or docking stations with video output.
  • Convert USB-A Ports to USB-C: Designed to connect USB-C earphones, cables, flash drives, card readers, and other USB-C accessories to standard USB-A ports. Plug-and-play with no drivers or software required.
  • Aluminum Alloy Housing: Built with a sturdy aluminum alloy shell that aids in heat dissipation and protects against daily wear and scratches. Designed to maintain a stable and secure connection.
  • Compact & Travel-Friendly: The ultra-compact design allows the adapter to stay plugged into your device without blocking adjacent ports or adding bulk, reducing wear and tear on your original USB ports.
  • 12-Month Warranty: Backed by a 12-month manufacturer warranty for peace of mind. Designed to meet strict quality control standards for reliable everyday performance.

Choose paths and names deliberately

baselineFolder identifies where reference images are kept; screenshotPath identifies where captured screenshots are stored. formatImageName controls the filename, not the folder. Include enough environment information in names to distinguish runs: the service supports fields such as tag, browser name and version, device, platform, viewport dimensions, and device pixel ratio. A capability’s logName can also distinguish browser or device configurations. Use the path options or a per-method folder option to change folders.

Write a test and create the first baseline

Navigate to a known page state, wait for your application’s content to settle, then call the check method that matches the scope you want to compare:

describe('home page visual appearance', () => {
  it('matches the home screen', async () => {
    await browser.url('http://localhost:3000/');
    await $('[data-testid="home-ready"]').waitForDisplayed();

    await browser.checkScreen('home');
  });
});

The readiness selector is application-specific: replace it with an element that indicates the page is ready for capture. A check method captures and compares in one step; a separate save call before each check is unnecessary. On the first run, the service creates a baseline automatically because autoSaveBaseline defaults to true. The initial image should still be reviewed as a deliberate reference, not assumed to be correct just because the test passed.

For initial setup, avoid combining save and compare methods when a check method already creates the baseline. If you want to control baseline creation explicitly, disable automatic baseline saving and use the documented save workflow instead. The writing tests guide, methods reference, and FAQ describe the available workflows.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #2
Anker USB-C Hub, 5-in-1 USB Hub for Laptops, 4K HDMI Multiport Adapter
  • 5-in-1 USB-C Hub: Experience comprehensive connectivity featuring a Power Delivery input, two USB-A 2.0 ports, a USB-A 3.0 port, and an HDMI port. (Note: The USB-C power delivery input port is only for connecting an external wall charger to power your laptop and cannot power peripheral devices.)
  • 90W Pass-Through Charging: Achieve optimal charging with 90W pass-through power to your laptop, supported by a total input of 100W, with the hub reserving 10W for operational efficiency. (Note: Wall charger not included.)
  • Quick Data Transfers: Accelerate your productivity with rapid data transfers using a high-speed 5Gbps USB 3.0 port and two 480Mbps USB 2.0 ports.
  • 4K HDMI Display: Enhance your visual experience with a hub capable of delivering 4K resolution at 30Hz in both mirror and extend modes. Please note that this hub is compatible with MacBook (macOS 12 and newer), Windows 10 and 11, ChromeOS, and laptops equipped with DP Alt Mode and Power Delivery. Note: This device is not compatible with Linux.
  • What You Get: Anker USB-C Hub (5-in-1, 4K HDMI), welcome guide, 18-month warranty, and our friendly customer service.

Pick the capture scope

  • browser.checkElement(selector, 'hero') compares a selected component, useful when the test is about that component rather than the whole screen.
  • browser.checkScreen('home') compares the current viewport.
  • browser.checkFullPageScreen('page') compares the full page.

Visual snapshot matchers are another option: for example, toMatchScreenSnapshot and toMatchElementSnapshot. Use one consistent style in a test suite so the intent and baseline names remain clear.

Make captures repeatable

Visual comparison is most useful when a difference reflects an application change rather than a changed rendering environment. Keep the baseline and test run on the same browser, operating system, device, viewport, and device pixel ratio where possible. WebdriverIO’s guidance is to compare screenshots within the same platform. Browser or operating-system updates can alter font rendering, so review diffs after changing them.

Stabilize the page state

  • Use predictable test data and authentication rather than changing production-like records.
  • Fix the viewport and device settings for a baseline set.
  • Wait for application-specific content to appear and for asynchronous UI changes to finish.
  • Account for animations, rotating content, timestamps, and other intentional variability using the service’s controls only where appropriate.

The service waits for fonts to load by default. Other controls can disable CSS animation, hide scrollbars or blinking carets, ignore selected regions, or enable layout testing, which makes text transparent to focus comparison on layout. Use ignored regions narrowly: a broad mask may conceal the very regression the test should catch. Comparison options also include anti-aliasing tolerance for small edge differences; enable it only if that tolerance suits the purpose of the test. See method options and comparison options.

Choose full-page capture based on page behavior

For desktop web full-page screenshots, the default capture uses WebDriver BiDi without scrolling. If content is lazy-loaded or rendering depends on scroll position, enable userBasedFullPageScreenshot. That mode scrolls through the page, captures viewport images, and stitches them together; it can take longer. Choose it when the page requires scrolling to render the content under test, rather than enabling it automatically.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #3
Sale
Anker USB C Hub, 7in1 Multi-Port USB Adapter, 4K@60Hz USBC to HDMI Splitter
  • Sleek 7-in-1 USB-C Hub: Features an HDMI port, two USB-A 3.0 ports, and a USB-C data port, each providing 5Gbps transfer speeds. It also includes a USB-C PD input port for charging up to 100W and dual SD and TF card slots, all in a compact design.
  • Flawless 4K@60Hz Video with HDMI: Delivers exceptional clarity and smoothness with its 4K@60Hz HDMI port, making it ideal for high-definition presentations and entertainment. (Note: Only the HDMI port supports video projection; the USB-C port is for data transfer only.)
  • Double Up on Efficiency: The two USB-A 3.0 ports and a USB-C port support a fast 5Gbps data rate, significantly boosting your transfer speeds and improving productivity.
  • Fast and Reliable 85W Charging: Offers high-capacity, speedy charging for laptops up to 85W, so you spend less time tethered to an outlet and more time being productive.
  • What You Get: Anker USB-C Hub (7-in-1), welcome guide, 18-month warranty, and our friendly customer service.

Resizing a desktop browser is not a substitute for checking a real mobile browser or device. WebdriverIO also advises against headless browsers for this visual service because the goal is to compare the end-user rendered view. Appium-backed mobile browsers, native apps, and hybrid apps are supported, but require context-specific setup; hybrid apps need isHybridApp: true.

Review diffs and update baselines safely

When a check finds a difference, inspect the baseline, actual screenshot, and diff image together. Decide whether the difference is an intended design change, a rendering-environment change, or a regression. Do not accept a new baseline solely to make a test pass.

The --update-visual-baseline CLI flag copies actual images over failing baselines, allowing the changed tests to pass. Run it only after reviewing the images and confirming that the new appearance is intended. Baselines are test artifacts: review them after browser, operating-system, device, font, or visual-service engine changes.

Version changes can affect comparison results. The WebdriverIO visual testing documentation says version 10 changed the comparison engine from ResembleJS to Pixelmatch. The docs describe Pixelmatch as using a perceptual YIQ color model; mismatch percentages can therefore differ from version 9. Review the actual diffs when upgrading instead of assuming an old threshold means the same thing.

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.
Rank #4
Sale
UGREEN USB to USB C Adapter Combo 4-Pack, 10Gbps USB C Converter Space Gray
  • Dual Converters, Infinite Potential:Includes 2× USB C male to USB A female adapters and 2× USB A male to USB C female adapters. Perfect for a wide range of uses—tablets with Bluetooth keyboards, expand USB ports on macbook, and more. Two different converters for all your daily needs
  • Next-Level 10Gbps & 3A Charging: No more slow 480Mbps, this usb to usb c adapter has a transfer speed of up to 10Gbps, allowing you to do more transferring in less time. This usb adapter fits both USB A and USB C charger, supporting up to 3A fast charging
  • Upgraded Exquisite Craftsmanship: With an aluminum alloy housing and metal connector, the usbc to usb adapter is extremely durable and sturdy. Rigorously tested to withstand more than 10,000 times of plugging and unplugging, ensuring long-lasting performance
  • Broad Compatible: The usb c to usb adapter widely supports all USB C/ USB A devices like laptops, tablets, cellphones, car chargers, and phone chargers. Such as compatible with MacBook Pro/Air 2023/2022, Thunderbolt 4/3 Devices,Apple MagSafe Watch 9/8/7/SE/Ultra, iPad Pro 2022/2021, Samsung Galaxy S23/S20/S10, and iPhone 17/16/15 Pro. Plug and play
  • Please Note: To reach 10Gbps speed, keep the cable under 3.3 ft. For USB A Male to USB C adapters, try flipping the USB C connector. USB C Male to USB A adapters support bidirectional 10Gbps transfer within 3.3 ft

Set mismatch tolerance with care

A mismatch percentage is not a quality verdict. On a large image, even a seemingly small threshold can permit a meaningful control or layout change. Use the diff image to identify what changed, then set thresholds and any anti-aliasing tolerance according to the risk of the page and the team’s review policy.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Run in CI and investigate failures

For repeatable CI results, keep the runner’s browser and platform consistent with the environment used to create the baseline. If CI uses a different operating system or browser version, expect rendering differences and maintain separate baselines where appropriate. A passing local test does not establish that a different CI renderer will produce identical pixels.

  • First run reports a missing baseline: confirm the configured baseline folder is writable and that automatic baseline creation is enabled, or follow the explicit save workflow.
  • Every run produces diffs: compare browser, platform, viewport, device pixel ratio, and font availability. Check whether the page state is changing or content is still loading at capture time.
  • Lazy content is absent in a full-page image: try userBasedFullPageScreenshot for pages whose content appears only during scrolling.
  • Tests fail after a service upgrade: inspect diffs and review comparison-engine changes, especially when moving to version 10 from version 9.
  • Too many unhelpful differences: stabilize the page and environment before increasing tolerance or masking regions. Narrow any ignored area to the dynamic content that cannot reasonably be stabilized.

WebdriverIO’s considerations page covers platform consistency, mobile simulation, headless guidance, and mismatch thresholds.

When to add a hosted visual review service

The built-in visual service is sufficient for local or CI screenshot comparisons against project-managed baselines. A hosted service may be useful when the team specifically needs hosted browser or device execution, or a shared visual review workflow. BrowserStack Percy is an optional integration, not a prerequisite for WebdriverIO visual tests. Its integration paths and supported WebdriverIO versions differ in vendor documentation: BrowserStack’s SDK page reports support up to WebdriverIO 8, while Percy SDK support is reported up to WebdriverIO 9. Check the current WebdriverIO Percy integration guide and BrowserStack integration documentation for the exact stack before implementing it.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Best Value
Anker USB C Hub, 5-in-1 USBC to HDMI Splitter with 4K Display
  • 5-in-1 Connectivity: Equipped with a 4K HDMI port, a 5 Gbps USB-C data port, two 5 Gbps USB-A ports, and a USB C 100W PD-IN port. Note: The USB C 100W PD-IN port supports only charging and does not support data transfer devices such as headphones or speakers.
  • Powerful Pass-Through Charging: Supports up to 85W pass-through charging so you can power up your laptop while you use the hub. Note: Pass-through charging requires a charger (not included). Note: To achieve full power for iPad, we recommend using a 45W wall charger.
  • Transfer Files in Seconds: Move files to and from your laptop at speeds of up to 5 Gbps via the USB-C and USB-A data ports. Note: The USB C 5Gbps Data port does not support video output.
  • HD Display: Connect to the HDMI port to stream or mirror content to an external monitor in resolutions of up to 4K@30Hz. Note: The USB-C ports do not support video output.
  • What You Get: Anker 332 USB-C Hub (5-in-1), welcome guide, our worry-free 18-month warranty, and friendly customer service.

Or skip the browser setup

If you need a clean screenshot rather than a visual regression suite, ScreenshotNeo offers a one-request screenshot API and an MCP server for AI agents. It is not a replacement for WebdriverIO’s baseline-and-diff workflow.

For API setup and response details, see the ScreenshotNeo documentation.

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

ScreenshotNeo removes known cookie and consent banners, newsletter popups, and chat widgets before capture; each cleanup step can be turned off. Bot checks, blank pages, timeouts, failed loads, and cache hits are not billed, and response headers report the page verdict and billing status. Its MCP server gives AI agents screenshot, page-info, and PDF-capture tools. The free plan includes 1,000 screenshots a month with no card; paid plans start at $5 for 3,000 screenshots.

Sign up for 1,000 free screenshots a month with no card.

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

Frequently Asked Questions

Does WebdriverIO visual testing work with CucumberJS?

Yes. The visual service supports WebdriverIO-supported frameworks including CucumberJS, Mocha, and Jasmine.

Can I use the service for native or hybrid mobile apps?

Yes, with Appium-backed setup specific to the target; hybrid apps require isHybridApp: true.

Do I need a separate screenshot save call before every visual check?

No. Check methods capture and compare the screenshot themselves.

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.

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

Leave a Reply

Your email address will not be published. Required fields are marked *

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

More from the Wire

  1. Shenzhen desk3 min
    HONOR Expands Beyond Smartphones With Humanoid Robot RevealHONOR said it unveiled its first humanoid robot at MWC 2026 and named shopping assistance, workplace inspections, and supportive companionship as intended uses. Later Robotics D1 claims and a reported…
  2. Cupertino desk5 min
    Apple Unveils AirPods Max 2: The Upgrade That Should Have Happened Years AgoAirPods Max 2 adds H2-powered audio features and Apple claims up to 1.5× more effective ANC, but its design, Smart Case, and 20-hour battery rating are unchanged. Wired lossless audio…
  3. Cupertino desk4 min
    Apple’s OLED Touch MacBooks Are Coming—but the Dynamic Island Is the Real GambleApple has not announced an OLED touchscreen MacBook, but reports point to high-end models arriving in late 2026 or early 2027. The reported Mac Dynamic Island could be useful, but…
Recommended PC Tool
Recommended PC Tool
Windows Errors? Fix Them Before They SpreadFree repair scan
Crashes, No Sound, or Screen Glitches?Free driver scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.