Used with {@link WebElement#sendKeys WebElement#sendKeys} on file input elements ({@code }) to detect when the entered key sequence defines the path to a file.

By default, WebElement's will enter all key sequences exactly as entered. You may set a {@linkplain WebDriver#setFileDetector file detector} on the parent WebDriver instance to define custom behavior for handling file elements. Of particular note is the {@link selenium-webdriver/remote.FileDetector}, which should be used when running against a remote Selenium Server.

### Hierarchy

- FileDetector

## Index

### Constructors

- constructor

### Methods

- handleFile

## Constructors

### constructor

- new FileDetector(): FileDetector

- #### Returns FileDetector

## Methods

### handleFile

- handleFile(driver: WebDriver, path: string): Promise<string>

- Handles the file specified by the given path, preparing it for use with the current browser. If the path does not refer to a valid file, it will be returned unchanged, otherwisee a path suitable for use with the current browser will be returned.

  This default implementation is a no-op. Subtypes may override this function for custom tailored file handling.

  package

  #### Parameters

  - ##### driver: WebDriver

    The driver for the current browser.

  - ##### path: string

    The path to process.

  #### Returns Promise<string>

  A promise for the processed file path.

Generated using TypeDoc