> ## 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.

# setInputFiles

Sets files for a file input element (`<input type="file">`).
The element is identified using one of the provided selector strategies.
Can be used to simulate file uploads.
Example: `setInputFiles(selector: "input[type='file']", files: [{ name: "file.txt", mimeType: "text/plain", data: "SGVsbG8gd29ybGQ=" }])`
The `data` field should be Base64 encoded content of the file.
Returns true if the files were successfully set.

## Definition

```graphql theme={null}
setInputFiles(
  selector: String
  text: String
  role: ARIARole
  label: String
  placeholder: String
  altText: String
  title: String
  testId: String
  filter: ElementFilterOptions
  files: [InputFileOptions]!
): Boolean!
```

## Arguments

### `selector`

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

The CSS selector for the element. Example: `"#username"` for `<input id="username" />`.

### `text`

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

Finds an element by its text content. Example: `"Login"` for `<button>Login</button>`.

### `role`

[ARIARole](/reference/graphql/enums/ariarole)

Finds an element by its ARIA role. Example: `"button"` for `<div role="button">Submit</div>`.

### `label`

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

Finds an element by its ARIA label. Example: `"Search button"` for `<button aria-label="Search button"><svg/></button>`.

### `placeholder`

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

Finds an element by its placeholder text. Example: `"Enter your email"` for `<input placeholder="Enter your email" />`.

### `altText`

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

Finds an element by its image alt text. Example: `"Company logo"` for `<img alt="Company logo" src="..." />`.

### `title`

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

Finds an element by its title attribute. Example: `"Close dialog"` for `<span title="Close dialog">X</span>`.

### `testId`

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

Finds an element by its data-testid attribute. Example: `"submit-button"` for `<button data-testid="submit-button">Go</button>`.

### `filter`

[ElementFilterOptions](/reference/graphql/inputs/element-filter-options)

Advanced filtering options for the element.

### `files`

[\[InputFileOptions\]!](/reference/graphql/inputs/input-file-options)

An array of file objects to set for the input. Each file needs a name, mimeType, and base64 encoded data.

## Returns

[Boolean!](/reference/graphql/scalars/boolean)

The `Boolean` scalar type represents `true` or `false`.
