---
title: Invalid selector
slug: Web/WebDriver/Errors/InvalidSelector
tags:
  - Error
  - Reference
  - WebDriver
  - invalid selector
---
The **invalid selector** error is a [WebDriver error](/en-US/docs/Web/WebDriver/Errors) that occurs when an element retrieval command is used with an unknown [web element](/en-US/docs/Web/WebDriver/WebElement) selector strategy.

The available selector strategies are [CSS](/en-US/docs/Web/WebDriver/WebElement#css-selector), [link text](/en-US/docs/Web/WebDriver/WebElement#link-text-selector), [partial link text](/en-US/docs/Web/WebDriver/WebElement#partial-link-text-selector), [tag name](/en-US/docs/Web/WebDriver/WebElement#tag-name-selector), and [XPath](/en-US/docs/Web/WebDriver/WebElement#tag-name-selector). Any other selector strategy is rejected with this error.

## See also

- [List of WebDriver errors](/en-US/docs/Web/WebDriver/Errors)
- [WebElement](/en-US/docs/Web/WebDriver/WebElement)
- Element retrieval commands:

  - [Find Element](/en-US/docs/Web/WebDriver/Commands/FindElement)
  - [Find Elements](/en-US/docs/Web/WebDriver/Commands/FindElements)
  - [Find Element From Element](/en-US/docs/Web/WebDriver/Commands/FindElementFromElement)
  - [Find Elements From Element](/en-US/docs/Web/WebDriver/Commands/FindElementsFromElement)
