• Skip to main content
  • Skip to search
  • Skip to select language
MDN Web Docs
  • References
    • Overview / Web Technology

      Web technology reference for developers

    • HTML

      Structure of content on the web

    • CSS

      Code used to describe document style

    • JavaScript

      General-purpose scripting language

    • HTTP

      Protocol for transmitting web resources

    • Web APIs

      Interfaces for building web applications

    • Web Extensions

      Developing extensions for web browsers

    • Accessibility

      Build web projects usable for all

    • Web Technology

      Web technology reference for developers

  • Learn
    • Overview / MDN Learning Area

      Learn web development

    • MDN Learning Area

      Learn web development

    • HTML

      Learn to structure web content with HTML

    • CSS

      Learn to style content using CSS

    • JavaScript

      Learn to run scripts in the browser

    • Accessibility

      Learn to make the web accessible to all

  • Plus
    • Overview

      A customized MDN experience

    • AI Help

      Get real-time assistance and support

    • Updates

      All browser compatibility updates at a glance

    • Documentation

      Learn how to use MDN Plus

    • FAQ

      Frequently asked questions about MDN Plus

  • Curriculum New
  • Blog
    • Playground

      Write, test and share your code

    • HTTP Observatory

      Scan a website for free

    • AI Help

      Get real-time assistance and support

  • Log in
  • Sign up for free
  1. References
  2. WebDriver
  3. Reference
  4. Errors
  5. Invalid selector
    • Deutsch

In this article

  • See also
  1. WebDriver
  2. Reference
  3. Timeouts
  4. Commands
    1. Close Window
    2. Get Element Attribute
    3. Get Element Property
    4. Get Element Tag Name
    5. Get Timeouts
    6. Get Window Handles
    7. Get Window Rect
    8. New Window
    9. Set Timeouts
    10. Set Window Rect
  5. Capabilities
    1. acceptInsecureCerts
    2. firefoxOptions
    3. webSocketUrl
  6. Errors
    1. Insecure certificate
    2. Invalid argument
    3. Invalid cookie domain
    4. Invalid selector
    5. Invalid session ID
    6. JavaScript error
    7. Script timeout
    8. Stale element reference
    9. Unknown command
    10. Unknown error
    11. Unknown method

In this article

  • See also

Invalid selector

The invalid selector error is a WebDriver error that occurs when an element retrieval command is used with an unknown web element selector strategy.

The available selector strategies are CSS, link text, partial link text, tag name, and XPath. Any other selector strategy is rejected with this error.

See also

  • List of WebDriver errors

  • WebElement

  • Element retrieval commands:

    • Find Element
    • Find Elements
    • Find Element From Element
    • Find Elements From Element

Help improve MDN

Learn how to contribute.

This page was last modified on Apr 28, 2025 by MDN contributors.

View this page on GitHub • Report a problem with this content
MDN logo

Your blueprint for a better internet.

  • MDN on Bluesky
  • MDN on Mastodon
  • MDN on X (formerly Twitter)
  • MDN on GitHub
  • MDN Blog RSS Feed

MDN

  • About
  • Blog
  • Careers
  • Advertise with us

Support

  • Product help
  • Report an issue

Our communities

  • MDN Community
  • MDN Forum
  • MDN Chat

Developers

  • Web Technologies
  • Learn Web Development
  • MDN Plus
  • Hacks Blog
  • Website Privacy Notice
  • Cookies
  • Legal
  • Community Participation Guidelines

Visit Mozilla Corporation’s not-for-profit parent, the Mozilla Foundation.
Portions of this content are ©1998–2025 by individual mozilla.org contributors. Content available under a Creative Commons license.

OSZAR »