October DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsPC HealthRecommendedCrashes, freezes, slowdowns? Check your PC nowSpot repairable issues before they interrupt work.Check PCOctober DealsAmazon USDeal season is back - check today's better picksAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
World desk6 min

How to Automate UI Testing from Scratch

Start UI automation with one high-value browser journey. Learn a Playwright first-test pattern, reliable waiting, CI setup, and how to choose test types.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Start with one browser test for a user journey that matters: open the page, interact through a user-visible control, and assert the result the user should see. This guide uses Playwright for a practical first test and CI setup, then explains when Cypress or another test level may suit your project better.

What UI automation should prove

A UI test should verify an outcome in the rendered application, not merely that a page loaded or a button can be clicked. Choose a task whose failure would matter—such as signing in or completing a core purchase—and define what the user should observe when it succeeds.

Browser-based end-to-end tests exercise the integrated journey, so they can catch failures that isolated unit or API tests cannot. They also require a working application, browser setup, CI resources, and ongoing maintenance. Begin with a small number of high-value flows rather than trying to automate every page.

Playwright’s Best Practices guide recommends interacting with the rendered output in the way an end user does. That points toward accessible, user-visible locators and assertions about meaningful results.

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.

Set up Playwright for your project

Use the current official installation instructions for the language and package manager your application already uses. Installation details differ by language, operating system, and package manager, so confirm the matching steps in Playwright’s Continuous Integration guide before copying commands into a project. For Node-based CI, the general sequence is to install project packages, install Playwright’s browser binaries and required system dependencies, and run the test command.

The example below is the official documentation pattern, not a claim of independent execution. Replace the sample URL and expected heading with your own app and the outcome your user should see.

import { test, expect } from '@playwright/test';

test('get started link', async ({ page }) => {
  await page.goto('https://playwright.dev/');
  await page.getByRole('link', { name: 'Get started' }).click();
  await expect(page.getByRole('heading', { name: 'Installation' })).toBeVisible();
});

The test navigates to a page, finds a link by its accessible role and name, clicks it, then checks for a visible heading. In your app, use a journey-specific test name and assert the final state that matters, such as a confirmation message after submitting a form.

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.

Write reliable actions and assertions

Prefer locators that express user intent

Role-based locators such as getByRole('button', { name: 'Sign in' }) describe how a user or assistive technology identifies a control. They are generally more resilient than selectors tied to incidental markup or styling. If a control lacks a useful accessible name, improving the application’s accessibility may make it easier to test and use.

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

Assert the outcome, not just the action

A click completing does not prove that a task succeeded. Follow important actions with an assertion on the visible state the user expects: a heading, confirmation, updated value, or newly available control. Playwright’s Writing tests guide demonstrates role-based locators and web-first expectations that retry while the expected condition is not yet true.

Wait for state instead of sleeping

Playwright checks actionability before performing actions and retries web-first assertions while waiting for the expected state. Prefer asserting that a confirmation appears or a control becomes available over adding a fixed delay. When a wait is genuinely necessary, tie it to an application state or a deliberately controlled network condition rather than an unexplained number of milliseconds.

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.

Run locally, then add CI

  1. Run the test locally with the command documented for your language and project setup. Confirm that it reaches the intended page and checks the intended outcome.
  2. Reproduce the setup in CI: install project dependencies cleanly, install the matching Playwright browsers and system dependencies, then run the test suite.
  3. Start with one worker. Playwright’s CI guidance recommends one worker initially to favor stability and reproducibility.
  4. Scale only when resources justify it. Consider parallel workers or sharding across CI jobs when your machine capacity and pipeline design can support them.
  5. Keep failure evidence useful. Preserve relevant artifacts and diagnostics, and investigate repeat failures rather than reflexively rerunning tests until they pass.

Browser and CI setup details can change. Check the current framework guidance for the exact browser support, versions, and provider-specific configuration used by your project.

Choose the right test level as you expand

Not every risk needs a full browser journey. Cypress’s Testing Types documentation describes end-to-end, component, and API testing as approaches for different needs, with accessibility checks able to layer onto them. Use the lightest test level that gives appropriate confidence; reserve end-to-end coverage for integrated user journeys where the browser path matters.

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.
  • End-to-end: validate important integrated flows through the browser.
  • Component: check a component in isolation when the question is about its behavior rather than a complete user journey.
  • API: verify service behavior without paying the setup and maintenance cost of a browser test when visual interaction is not the risk.
  • Accessibility: add checks as a layer, rather than treating them as a replacement for other test types.

Playwright or Cypress: how to decide

There is no universal winner established across all stacks. Playwright provides a clear starter pattern and CI path; Cypress is also a credible option. Compare them against your application and team rather than relying on an unsupported benchmark.

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
Decision area What to check
Browser and runtime needs Which browsers and operating systems you need locally and in CI; confirm current official support for the exact version.
Authoring model Whether the team prefers Playwright’s async/await style and integrated test runner or Cypress’s command-chaining and interactive local workflow.
Locators and synchronization Whether the framework supports user-visible locators and condition-based waiting for the application states your tests need.
CI setup Browser installation, system dependencies, worker limits, and whether your infrastructure can support parallel jobs or sharding.
Debugging and reporting Local debugging features, failure artifacts, and what the team needs for visibility. Cypress documents Cypress Cloud and other product offerings; pricing and terms are not covered here.
Application and team fit Your language, frontend framework, existing testing skills, and constraints in the current CI environment.

Cypress describes its local app, Cypress Cloud, UI Coverage, accessibility offerings, automatic waiting, and debugging features on its Why Cypress? page. Verify current capabilities and compatibility against official documentation when making a project decision.

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

Common problems and practical fixes

The test cannot find a control

Check that the page reached the expected state and that the locator’s role and accessible name match the rendered control. Prefer correcting a missing or unclear accessible name over anchoring a test to fragile styling or incidental markup.

The test passes locally but fails in CI

Compare the local and CI dependency and browser setup. Ensure CI installs the matching browser binaries and system dependencies, and begin with one worker so shared-state or resource contention is less likely to obscure the cause.

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.

The test is flaky around navigation or loading

Replace fixed sleeps with an assertion on the expected page state. Actions include actionability checks, while web-first assertions retry until the condition is true; a timeout often indicates an unmet expectation or an application/setup issue worth diagnosing.

The suite is slow or costly to maintain

Review whether each browser test protects a meaningful integrated journey. Move checks that do not require the browser to an appropriate lower-level test, and add parallel execution only when available CI resources justify it.

Or skip the browser setup: ScreenshotNeo

For screenshot capture rather than full interaction testing, ScreenshotNeo is a website screenshot API and MCP server. A single GET request can return a PNG, JPEG, WebP, or PDF; it does not replace an end-to-end test that clicks through and verifies application behavior.

Here is the one-call cURL example, targeting the Playwright sample site. See the ScreenshotNeo API documentation for request options.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://playwright.dev/ -o shot.webp
  • Cookie banners are accepted and removed, along with known consent platforms, newsletter popups, and chat widgets; each cleanup step can be turned off.
  • Bot checks or CAPTCHAs, blank pages, timeouts, failed loads, and cache hits are not billed; response headers report the page verdict and billing status.
  • An MCP server provides take_screenshot, get_page_info, and capture_pdf tools for AI agents and MCP clients.
  • The Free plan includes 1,000 shots per month without a card; paid plans start at $5 for 3,000 shots. Yearly billing gives two months free, and every feature is on every plan.

Sign up for ScreenshotNeo’s free plan to get 1,000 screenshots a month with no card.

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.

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
Crashes, No Sound, or Screen Glitches?Free driver scan
PC Slower Than It Used to Be?Free scan - under a minute

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.