> ## Documentation Index
> Fetch the complete documentation index at: https://docs.extractbase.com/llms.txt
> Use this file to discover all available pages before exploring further.

# ElementOptions

Defines various ways to select an element on the page.
At least one selector option (selector, xpath, text, role, etc.) must be provided.
These options are used by queries like `element` and mutations like `click`, `fill`, etc.

## Definition

```graphql theme={null}
input ElementOptions {
  selector: String
  xpath: String
  text: String
  role: String
  label: String
  placeholder: String
  altText: String
  title: String
  testId: String
}
```

## Fields

### `selector`

[String](/reference/graphql/scalars/string)

A CSS selector. Example: `"div.item[data-id='123']"` or `"#submitButton"`.

### `xpath`

[String](/reference/graphql/scalars/string)

An XPath selector. Example: `//button[@id='submit']`. While the generic `selector` field can also accept XPath prefixed with `xpath=`, this `xpath` field is dedicated exclusively to XPath expressions.

### `text`

[String](/reference/graphql/scalars/string)

Matches elements by their exact or partial text content. Case-sensitive.
Example: `"Login"` or `"Add to Cart"`

### `role`

[String](/reference/graphql/scalars/string)

Matches elements by their ARIA role. Example: `"button"`, `"link"`, `"navigation"`.

### `label`

[String](/reference/graphql/scalars/string)

Matches elements by their ARIA label. Example: `"Close notification"`.

### `placeholder`

[String](/reference/graphql/scalars/string)

Matches input elements by their placeholder attribute. Example: `"Enter your username"`.

### `altText`

[String](/reference/graphql/scalars/string)

Matches `<img>` elements by their alt attribute. Example: `"User profile picture"`.

### `title`

[String](/reference/graphql/scalars/string)

Matches elements by their title attribute. Example: `"Click to learn more"`.

### `testId`

[String](/reference/graphql/scalars/string)

Matches elements by their 'data-testid' attribute, commonly used for testing. Example: `"login-form-submit"`.
