WebdriverIO uses WebDriver’s element-location capabilities through its own element-query commands: $() finds one matching element, and $$() finds multiple matches. In WebdriverIO, these are called selectors. CSS is the default query form; XPath and other documented selector forms are available when you specify them. “Selenium locator” is useful shorthand for the underlying WebDriver concept, but not every WebdriverIO selector syntax is a separate protocol-level locator strategy.
How WebdriverIO uses Selenium locators
The WebDriver protocol provides commands to find one element or a collection of elements. WebdriverIO exposes these through its element-query APIs, with $() and $$() as the convenient methods for normal use. The names are WebdriverIO APIs, not jQuery or Sizzle functions. See the WebDriver Protocol API reference and the WebdriverIO selector guide.
In practice, a selector is the expression you pass to a query command. Some expressions map to familiar WebDriver strategies, such as CSS or XPath; others are WebdriverIO-supported forms with framework-specific behavior. Avoid assuming every form is an independent, universally supported WebDriver protocol strategy.
Find one or several elements
Use $() when your next action or assertion concerns one match, and $$() when you need a collection. For example:
Recommended Free Tools
#1 Best Overall
- 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.
const submitButton = await $('[data-testid="submit"]');
await submitButton.click();
const links = await $$('a');
console.log(`Found ${links.length} links`);
The examples show the query shape; they assume they run inside a configured WebdriverIO test or command context. WebdriverIO documents repeated DOM queries as something to limit where practical, so retain and reuse an element reference when that suits the test rather than repeatedly querying for the same target. See WebdriverIO Best Practices.
Choose a selector that fits the element
| Need | Example | What to know |
|---|---|---|
| Default browser query | $('.checkout button') |
CSS is the default when no other strategy is indicated. |
| Element with an HTML ID | $('#someid') |
Use a CSS ID selector, or XPath such as $('//*[@id="someid"]'). The general WebDriver protocol does not define id as a locator strategy. |
| Exact user-facing text | $('button=Submit') |
WebdriverIO supports exact-text selector syntax. It can express what a user sees, but translations or copy changes can require updating the test. |
| Partial link text | $('*=driver') |
WebdriverIO documents this form for partial link-text matching. |
| Accessible name | $('aria/Submit') |
Queries by accessible name. The implementation depends on session type, as described below. |
| XPath | $('//button[@type="submit"]') |
Use an explicit XPath expression when its document relationship or matching logic is useful. |
| Driver-specific ID strategy | $('id=someid') |
Do not rely on this as a general browser WebDriver strategy. Some drivers, including certain Appium drivers, may support it. |
For the ID examples, replace someid with the element’s actual HTML id value. The selector syntax and session details are documented in the WebdriverIO selector guide.
Rank #2
- 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.
Prefer resilient, meaningful selectors
A selector that describes an element’s purpose is usually easier to maintain than one that depends on incidental markup or styling. The WebdriverIO guide identifies a generic tag query such as $('button') and a style-coupled class query such as $('.btn.btn-large') as poor choices in its examples, while showing $('[data-testid="submit"]') and $('aria/Submit') as better alternatives.
- Use a test attribute when the application team can provide a stable, purposeful attribute such as
data-testid. - Use accessible names or exact visible text when the test should track the language a user or assistive technology encounters.
- Account for localization. Visible labels and accessible names may change with translated copy. Where applicable, WebdriverIO recommends using translation files rather than embedding a single language’s text in tests.
- Avoid styling hooks unless the style class itself is the behavior under test; redesigns can change classes without changing what the control does.
These are maintainability recommendations, not a promise that one locator is always fastest or infallible. Selector resilience depends on how the application is built and how the test is intended to behave.
Quick wins for a faster PC:
Clear out junk files and repair common Windows errorsFree Scan →Fix the driver behind crashes, sound loss and screen glitchesFind Drivers →Rank #3
- 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.
CSS or XPath: which should you use?
Use CSS for straightforward attributes, IDs, classes, and relationships it can express clearly. Use XPath when you need XPath’s document-navigation or matching capabilities. Both are documented WebDriver query strategies, but readability and resilience should drive the choice more than a blanket speed claim. A query tied to a transient class can break regardless of whether it is written in CSS or XPath.
For example, a stable test attribute is generally clearer than selecting a submit button by a long chain of layout classes. If the test’s purpose is to verify the user-visible submit action, an accessible name or exact text can communicate that intent more directly—provided the test handles language changes appropriately.
Rank #4
- 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
Session and platform behavior that can change the result
Accessible-name selectors and BiDi
According to the current WebdriverIO selector guide, a WebDriver BiDi session uses an accessibility locator against the browser’s accessibility tree for aria/ queries. In a Classic session, WebdriverIO uses a heuristic XPath fallback. The same selector spelling therefore should not be treated as evidence that every session uses the same underlying query mechanism.
Shadow DOM in WebdriverIO v9
The guide states that WebdriverIO v9 automatically pierces shadow DOM. The older >>> deep-selector workaround is unnecessary in v9. This is version-specific behavior; check the guide for the version used by your project rather than carrying older selector recipes forward uncritically.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
Best Value
- 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.
Mobile and Appium selectors
Mobile selector forms can rely on Appium or a compatible driver, and support may depend on whether the target is iOS or Android and on the selected driver. Treat those forms as platform- and driver-specific, not as universal browser WebDriver strategies. Confirm support in the WebdriverIO selector guide and the documentation for your actual driver.
Common locator problems and fixes
- An ID selector returns no match: confirm the element is present in the current page and that the CSS selector uses the real HTML ID, for example
$('#someid'). Do not assumeid=someidis supported by every browser driver. - An exact-text selector stops matching: check for changed wording, punctuation, or locale. If translated text is intentional, source expected strings from the applicable translation files or use a stable test attribute when visible copy is not what the test needs to verify.
- A class-based selector breaks after a redesign: replace styling-dependent classes with a purposeful test attribute or an appropriate semantic selector.
- An
aria/result differs between sessions: check whether the session uses WebDriver BiDi or Classic; WebdriverIO documents different mechanisms for those cases. - A shadow-DOM query uses an old workaround: if the project uses WebdriverIO v9, remove the obsolete
>>>workaround and follow the current guide. - A mobile selector works on one device but not another: verify the platform and driver’s support for that selector form; mobile strategies are not all portable.
Or skip the browser setup
ScreenshotNeo is a separate option when you need a rendered page screenshot or PDF rather than an interactive WebdriverIO locator. One GET request can return an image or PDF; it does not replace DOM querying or browser interaction in a test.
Quick Recap
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp
See the ScreenshotNeo API documentation. Its capture flow accepts cookie or consent banners and removes more than 60 known consent platforms, newsletter popups, and chat widgets before the shot; those steps can be turned off. Bot checks, blank pages, timeouts, failed loads, and cache hits are not billed, and response headers identify the page verdict and billing status. An MCP server provides take_screenshot, get_page_info, and capture_pdf tools for AI agents. The free plan includes 1,000 screenshots per month with no card; paid plans start at $5 for 3,000.
Sign up for ScreenshotNeo’s free plan.
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.
The Tool Desk
Outbyte Driver Updater FREEFix the driver behind crashes, sound loss and screen glitchesFind Drivers →Outbyte PC Repair FREEClear out junk files and repair common Windows errorsFree Scan →




