Selenium Standalone
fileโ
Upload a file to remote machine on which the browser is running.
Selenium Standalone command. More details can be found in the official protocol docs.
Usageโ
await browser.file(file)
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โ
- <String>
path: Absolute path of uploaded file on remote machine.
getDownloadableFilesโ
List files from remote machine available for download.
Selenium Standalone command. More details can be found in the official protocol docs.
Usageโ
await browser.getDownloadableFiles()
Returnsโ
- <Object>
names: Object containing a list of downloadable files on remote machine.
downloadโ
Download a file from remote machine on which the browser is running.
Selenium Standalone command. More details can be found in the official protocol docs.
Usageโ
await browser.download(name)
Parametersโ
| Name | Type | Details |
|---|---|---|
name | string | Name of the file to be downloaded |
Returnsโ
- <Object>
data: Object containing downloaded file name and its content
deleteDownloadableFilesโ
Remove all downloadable files from remote machine on which the browser is running.
Selenium Standalone command. More details can be found in the official protocol docs.
Usageโ
await browser.deleteDownloadableFiles()
getHubConfigโ
Receive hub config remotely.
Selenium Standalone command. More details can be found in the official protocol docs.
Usageโ
await browser.getHubConfig()
Returnsโ
- <Object>
config: Returns the hub config with slotCount, timeouts and other information.
gridTestSessionโ
Get the details of the Selenium Grid node running a session.
Selenium Standalone command. More details can be found in the official protocol docs.
Usageโ
await browser.gridTestSession(session)
Parametersโ
| Name | Type | Details |
|---|---|---|
session | String | The id of the session to receive hub details for. |
Returnsโ
- <Object>
details: Object containing information about session details.
gridProxyDetailsโ
Get proxy details.
Selenium Standalone command. More details can be found in the official protocol docs.
Usageโ
await browser.gridProxyDetails(id)
Parametersโ
| Name | Type | Details |
|---|---|---|
id | string | the id of the proxy (can be received using gridTestSession command). |
Returnsโ
- <Object>
details: Object containing information about proxy.
manageSeleniumHubLifecycleโ
Manage lifecycle of hub node.
Selenium Standalone command. More details can be found in the official protocol docs.
Usageโ
await browser.manageSeleniumHubLifecycle(action)
Parametersโ
| Name | Type | Details |
|---|---|---|
action | String | Command to call on Selenium Hub. The only implemented action is to 'shutdown' the hub. |
queryGridโ
Send GraphQL queries to the Selenium (hub or node) server to fetch data. (Only supported with Selenium v4 Server)
Selenium Standalone command. More details can be found in the official protocol docs.
Usageโ
await browser.queryGrid(query)
Parametersโ
| Name | Type | Details |
|---|---|---|
query | string | A GraphQL query to be send to the server. |
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โ
- <Object>
data: Result of the GraphQL query.