# Selenium Standalone

## file[​](#file "Direct link to file")

Upload a file to remote machine on which the browser is running.<br /><br />Selenium Standalone command. More details can be found in the [official protocol docs](https://www.seleniumhq.org/).

### Usage[​](#usage "Direct link to Usage")

```
await browser.file(file)
```

### Parameters[​](#parameters "Direct link to Parameters")

| Name   | Type     | Details                                                                                                                                                                                                    |
| ------ | -------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `file` | `string` | Base64-encoded zip archive containing **single** file which to upload. In case base64-encoded data does not represent a zip archive or archive contains more than one file it will throw an unknown error. |

### Returns[​](#returns "Direct link to Returns")

* **\<String>** **`path`:** Absolute path of uploaded file on remote machine.

***

## getDownloadableFiles[​](#getdownloadablefiles "Direct link to getDownloadableFiles")

List files from remote machine available for download.<br /><br />Selenium Standalone command. More details can be found in the [official protocol docs](https://www.seleniumhq.org/).

### Usage[​](#usage-1 "Direct link to Usage")

```
await browser.getDownloadableFiles()
```

### Returns[​](#returns-1 "Direct link to Returns")

* **\<Object>** **`names`:** Object containing a list of downloadable files on remote machine.

***

## download[​](#download "Direct link to download")

Download a file from remote machine on which the browser is running.<br /><br />Selenium Standalone command. More details can be found in the [official protocol docs](https://www.seleniumhq.org/).

### Usage[​](#usage-2 "Direct link to Usage")

```
await browser.download(name)
```

### Parameters[​](#parameters-1 "Direct link to Parameters")

| Name   | Type     | Details                           |
| ------ | -------- | --------------------------------- |
| `name` | `string` | Name of the file to be downloaded |

### Returns[​](#returns-2 "Direct link to Returns")

* **\<Object>** **`data`:** Object containing downloaded file name and its content

***

## deleteDownloadableFiles[​](#deletedownloadablefiles "Direct link to deleteDownloadableFiles")

Remove all downloadable files from remote machine on which the browser is running.<br /><br />Selenium Standalone command. More details can be found in the [official protocol docs](https://www.seleniumhq.org/).

### Usage[​](#usage-3 "Direct link to Usage")

```
await browser.deleteDownloadableFiles()
```

***

## getHubConfig[​](#gethubconfig "Direct link to getHubConfig")

Receive hub config remotely.<br /><br />Selenium Standalone command. More details can be found in the [official protocol docs](https://github.com/nicegraham/selenium-grid2-api#gridapihub).

### Usage[​](#usage-4 "Direct link to Usage")

```
await browser.getHubConfig()
```

### Returns[​](#returns-3 "Direct link to Returns")

* **\<Object>** **`config`:** Returns the hub config with slotCount, timeouts and other information.

***

## gridTestSession[​](#gridtestsession "Direct link to gridTestSession")

Get the details of the Selenium Grid node running a session.<br /><br />Selenium Standalone command. More details can be found in the [official protocol docs](https://github.com/nicegraham/selenium-grid2-api#gridapitestsession).

### Usage[​](#usage-5 "Direct link to Usage")

```
await browser.gridTestSession(session)
```

### Parameters[​](#parameters-2 "Direct link to Parameters")

| Name      | Type     | Details                                           |
| --------- | -------- | ------------------------------------------------- |
| `session` | `String` | The id of the session to receive hub details for. |

### Returns[​](#returns-4 "Direct link to Returns")

* **\<Object>** **`details`:** Object containing information about session details.

***

## gridProxyDetails[​](#gridproxydetails "Direct link to gridProxyDetails")

Get proxy details.<br /><br />Selenium Standalone command. More details can be found in the [official protocol docs](https://github.com/nicegraham/selenium-grid2-api#gridapiproxy).

### Usage[​](#usage-6 "Direct link to Usage")

```
await browser.gridProxyDetails(id)
```

### Parameters[​](#parameters-3 "Direct link to Parameters")

| Name | Type     | Details                                                              |
| ---- | -------- | -------------------------------------------------------------------- |
| `id` | `string` | the id of the proxy (can be received using gridTestSession command). |

### Returns[​](#returns-5 "Direct link to Returns")

* **\<Object>** **`details`:** Object containing information about proxy.

***

## manageSeleniumHubLifecycle[​](#manageseleniumhublifecycle "Direct link to manageSeleniumHubLifecycle")

Manage lifecycle of hub node.<br /><br />Selenium Standalone command. More details can be found in the [official protocol docs](https://github.com/nicegraham/selenium-grid2-api#lifecycle-manager).

### Usage[​](#usage-7 "Direct link to Usage")

```
await browser.manageSeleniumHubLifecycle(action)
```

### Parameters[​](#parameters-4 "Direct link to Parameters")

| Name     | Type     | Details                                                                                |
| -------- | -------- | -------------------------------------------------------------------------------------- |
| `action` | `String` | Command to call on Selenium Hub. The only implemented action is to 'shutdown' the hub. |

***

## queryGrid[​](#querygrid "Direct link to queryGrid")

Send GraphQL queries to the Selenium (hub or node) server to fetch data. (Only supported with Selenium v4 Server)<br /><br />Selenium Standalone command. More details can be found in the [official protocol docs](https://www.selenium.dev/documentation/grid/advanced_features/graphql_support/).

### Usage[​](#usage-8 "Direct link to Usage")

```
await browser.queryGrid(query)
```

### Parameters[​](#parameters-5 "Direct link to Parameters")

| Name    | Type     | Details                                   |
| ------- | -------- | ----------------------------------------- |
| `query` | `string` | A GraphQL query to be send to the server. |

### Example[​](#example "Direct link to Example")

```
const result = await browser.queryGrid('{ nodesInfo { nodes { status, uri } } }');
console.log(JSON.stringify(result, null, 4))
/**
 * outputs:
 * {
 *   "data": {
 *     "nodesInfo": {
 *       "nodes": [{
 *         "status": "UP",
 *         "uri": "http://192.168.0.39:4444"
 *       }]
 *     }
 *   }
 * }
 */
```

### Returns[​](#returns-6 "Direct link to Returns")

* **\<Object>** **`data`:** Result of the GraphQL query.
