Skip to content

Documentation / automate / AutomateClient

Class: AutomateClient

Defined in: automate/src/index.ts:5

Internal

Extends

Constructors

Constructor

new AutomateClient(options?): AutomateClient

Defined in: automate/src/index.ts:6

Parameters

ParameterType
options?BrowserStackOptions

Returns

AutomateClient

Overrides

GeneratedAutomateClient.constructor

Properties

PropertyModifierTypeInherited fromDefined in
authHeader?readonlystringGeneratedAutomateClient.authHeadercore/src/api-client.ts:50
baseUrlsreadonlyobjectGeneratedAutomateClient.baseUrlscore/src/api-client.ts:49
baseUrls.sdkpublicstring-core/src/api-client.ts:49
baseUrls.sdkCloudpublicstring-core/src/api-client.ts:49
fetchFnreadonly(input, init?) => Promise<Response>GeneratedAutomateClient.fetchFncore/src/api-client.ts:52
registryreadonlyCodecRegistryGeneratedAutomateClient.registrycore/src/api-client.ts:53
userAgentreadonlystringGeneratedAutomateClient.userAgentcore/src/api-client.ts:51

Methods

deleteBuild()

deleteBuild(buildId, options?): Promise<{ message?: string; status?: string; }>

Defined in: openapi/generated/automate.client.ts:480

Delete a build on the server. Please note that deleting a build will delete all the sessions contained within it. Builds once deleted cannot be recovered

Parameters

ParameterType
buildIdstring
options?ExecuteOptions

Returns

Promise<{ message?: string; status?: string; }>

Inherited from

GeneratedAutomateClient.deleteBuild


deleteBuilds()

deleteBuilds(buildId?, options?): Promise<{ message?: string; }>

Defined in: openapi/generated/automate.client.ts:344

Delete multiple builds on the server. You can delete a maximum of 5 builds at a time. Builds once deleted cannot be recovered.

Parameters

ParameterType
buildId?string[]
options?ExecuteOptions

Returns

Promise<{ message?: string; }>

Inherited from

GeneratedAutomateClient.deleteBuilds


deleteMediaFile()

deleteMediaFile(mediaId, options?): Promise<{ success: boolean; }>

Defined in: openapi/generated/automate.client.ts:429

Delete a media file on the server. Media files once deleted cannot be recovered

Parameters

ParameterType
mediaIdstring
options?ExecuteOptions

Returns

Promise<{ success: boolean; }>

Inherited from

GeneratedAutomateClient.deleteMediaFile


deleteProject()

deleteProject(projectId, options?): Promise<{ message?: string; status?: string; }>

Defined in: openapi/generated/automate.client.ts:599

Delete a project on the server using the DELETE method. Please note that to delete a project, it needs to be empty of builds and sessions, and projects once deleted cannot be recovered

Parameters

ParameterType
projectIdstring
options?ExecuteOptions

Returns

Promise<{ message?: string; status?: string; }>

Inherited from

GeneratedAutomateClient.deleteProject


deleteSession()

deleteSession(sessionId, options?): Promise<{ message?: string; status?: string; }>

Defined in: openapi/generated/automate.client.ts:395

Delete a session on the server. Sessions once deleted cannot be recovered

Parameters

ParameterType
sessionIdstring
options?ExecuteOptions

Returns

Promise<{ message?: string; status?: string; }>

Inherited from

GeneratedAutomateClient.deleteSession


deleteSessions()

deleteSessions(sessionId?, options?): Promise<{ message?: string; }>

Defined in: openapi/generated/automate.client.ts:412

Delete multiple sessions on the server. Sessions once deleted cannot be recovered.

Parameters

ParameterType
sessionId?string[]
options?ExecuteOptions

Returns

Promise<{ message?: string; }>

Inherited from

GeneratedAutomateClient.deleteSessions


execute()

protected execute<T>(spec): Promise<T>

Defined in: core/src/api-client.ts:103

Internal

Type Parameters

Type ParameterDefault type
Tunknown

Parameters

ParameterType
spec{[key: string]: unknown; baseUrl?: "sdk" | "sdkCloud"; method: HttpMethod; operationId: string; params?: { path?: Record<string, unknown>; query?: Record<string, unknown>; }; path: string; requestCodec?: string; requestCodecConfig?: unknown; requestInput?: unknown; responseCodec: string; responseCodecConfig: unknown; signal?: AbortSignal; }
spec.baseUrl?"sdk" | "sdkCloud"
spec.methodHttpMethod
spec.operationIdstring
spec.params?{ path?: Record<string, unknown>; query?: Record<string, unknown>; }
spec.params.path?Record<string, unknown>
spec.params.query?Record<string, unknown>
spec.pathstring
spec.requestCodec?string
spec.requestCodecConfig?unknown
spec.requestInput?unknown
spec.responseCodecstring
spec.responseCodecConfigunknown
spec.signal?AbortSignal

Returns

Promise<T>

Inherited from

GeneratedAutomateClient.execute


getBrowsers()

getBrowsers(options?): Promise<object[]>

Defined in: openapi/generated/automate.client.ts:259

Fetches all automate browsers.

Parameters

ParameterType
options?ExecuteOptions

Returns

Promise<object[]>

Inherited from

GeneratedAutomateClient.getBrowsers


getBuild()

getBuild(buildId, options?): Promise<GetAutomateBuildResult>

Defined in: openapi/generated/automate.client.ts:446

Fetches a build

Parameters

ParameterType
buildIdstring
options?ExecuteOptions

Returns

Promise<GetAutomateBuildResult>

Inherited from

GeneratedAutomateClient.getBuild


getBuilds()

getBuilds(projectId?, limit?, offset?, status?, options?): Promise<GetAutomateBuildsResult>

Defined in: openapi/generated/automate.client.ts:718

Fetch the 10 recent test builds that have run on BrowserStack. You can also limit the number of builds and paginate through your data

Parameters

ParameterType
projectId?string
limit?string
offset?string
status?string
options?ExecuteOptions

Returns

Promise<GetAutomateBuildsResult>

Inherited from

GeneratedAutomateClient.getBuilds


getMediaFiles()

getMediaFiles(options?): Promise<object[]>

Defined in: openapi/generated/automate.client.ts:650

Fetches list of recently uploaded media files

Parameters

ParameterType
options?ExecuteOptions

Returns

Promise<object[]>

Inherited from

GeneratedAutomateClient.getMediaFiles


getPlan()

getPlan(options?): Promise<{ automatePlan: string; parallelSessionsMaxAllowed: number; parallelSessionsRunning: number; queuedSessions: number; queuedSessionsMaxAllowed: number; teamParallelSessionsMaxAllowed: number; }>

Defined in: openapi/generated/automate.client.ts:276

Fetches Automate plan details

Parameters

ParameterType
options?ExecuteOptions

Returns

Promise<{ automatePlan: string; parallelSessionsMaxAllowed: number; parallelSessionsRunning: number; queuedSessions: number; queuedSessionsMaxAllowed: number; teamParallelSessionsMaxAllowed: number; }>

Inherited from

GeneratedAutomateClient.getPlan


getProject()

getProject(projectId, options?): Promise<{ builds: object[]; createdAt: string; groupId: number; id: number; name: string; subGroupId: number; updatedAt: string; userId: number; }>

Defined in: openapi/generated/automate.client.ts:565

Specific information about a particular project can be queried using the project ID

Parameters

ParameterType
projectIdstring
options?ExecuteOptions

Returns

Promise<{ builds: object[]; createdAt: string; groupId: number; id: number; name: string; subGroupId: number; updatedAt: string; userId: number; }>

Inherited from

GeneratedAutomateClient.getProject


getProjectBadgeKey()

getProjectBadgeKey(projectId, options?): Promise<string>

Defined in: openapi/generated/automate.client.ts:310

Fetches the badge key for sharing a public link for the Automate dashboard to view the latest build and sessions for that project

Parameters

ParameterType
projectIdstring
options?ExecuteOptions

Returns

Promise<string>

Inherited from

GeneratedAutomateClient.getProjectBadgeKey


getProjects()

getProjects(options?): Promise<object[]>

Defined in: openapi/generated/automate.client.ts:667

Fetches list of projects associated with your username and access key. You will need the id of the project for invoking any other Project API that follows in this document

Parameters

ParameterType
options?ExecuteOptions

Returns

Promise<object[]>

Inherited from

GeneratedAutomateClient.getProjects


getSession()

getSession(sessionId, options?): Promise<{ appiumLogsUrl: string; browser: string; browserConsoleLogsUrl: string; browserstackStatus: string; browserUrl: string; browserVersion: string; buildName: string; createdAt: string; device?: string; duration: number; harLogsUrl: string; hashedId: string; logs: string; name: string; os: string; osVersion: string; projectName: string; publicUrl: string; realMobile?: boolean; reason: string; seleniumLogsUrl: string; seleniumTelemetryLogsUrl: string; status: "done" | "running" | "timeout" | "failed"; videoUrl: string; }>

Defined in: openapi/generated/automate.client.ts:361

Fetches a session for a particular build

Parameters

ParameterType
sessionIdstring
options?ExecuteOptions

Returns

Promise<{ appiumLogsUrl: string; browser: string; browserConsoleLogsUrl: string; browserstackStatus: string; browserUrl: string; browserVersion: string; buildName: string; createdAt: string; device?: string; duration: number; harLogsUrl: string; hashedId: string; logs: string; name: string; os: string; osVersion: string; projectName: string; publicUrl: string; realMobile?: boolean; reason: string; seleniumLogsUrl: string; seleniumTelemetryLogsUrl: string; status: "done" | "running" | "timeout" | "failed"; videoUrl: string; }>

Inherited from

GeneratedAutomateClient.getSession


getSessionAppiumLogs()

getSessionAppiumLogs(sessionId, options?): Promise<string>

Defined in: openapi/generated/automate.client.ts:293

Fetches Appium logs for a session. Raw Appium Logs for each session are available to you in text format.

Parameters

ParameterType
sessionIdstring
options?ExecuteOptions

Returns

Promise<string>

Inherited from

GeneratedAutomateClient.getSessionAppiumLogs


getSessionConsoleLogs()

getSessionConsoleLogs(sessionId, options?): Promise<string>

Defined in: openapi/generated/automate.client.ts:684

Fetches console logs for a session. Console logs are enabled by default and are set to errors. You can disable them or change verbosity options by using the browserstack.console capability to disabled, errors, warnings, info, verbose. Raw Console Logs for each session are available to you in text format.

Parameters

ParameterType
sessionIdstring
options?ExecuteOptions

Returns

Promise<string>

Inherited from

GeneratedAutomateClient.getSessionConsoleLogs


getSessionLogs()

getSessionLogs(sessionId, options?): Promise<string>

Defined in: openapi/generated/automate.client.ts:497

Fetches session logs. Whenever you execute a session on BrowserStack, a session log is generated. These logs are available to you in text format.

Parameters

ParameterType
sessionIdstring
options?ExecuteOptions

Returns

Promise<string>

Inherited from

GeneratedAutomateClient.getSessionLogs


getSessionNetworkLogs()

getSessionNetworkLogs(sessionId, options?): Promise<{[key: string]: never; }>

Defined in: openapi/generated/automate.client.ts:735

Fetches network logs for a session. Network Logs for each session are available to you in HAR (HTTP Archive) format.

Parameters

ParameterType
sessionIdstring
options?ExecuteOptions

Returns

Promise<{[key: string]: never; }>

Inherited from

GeneratedAutomateClient.getSessionNetworkLogs


getSessions()

getSessions(buildId, limit?, offset?, status?, options?): Promise<GetAutomateSessionsResult>

Defined in: openapi/generated/automate.client.ts:548

Fetches list of sessions for a particular build

Parameters

ParameterType
buildIdstring
limit?string
offset?string
status?string
options?ExecuteOptions

Returns

Promise<GetAutomateSessionsResult>

Inherited from

GeneratedAutomateClient.getSessions


getSessionSeleniumLogs()

getSessionSeleniumLogs(sessionId, options?): Promise<string>

Defined in: openapi/generated/automate.client.ts:616

Fetches Selenium logs for a session. Raw Selenium logs for each session are available to you in text format.

Parameters

ParameterType
sessionIdstring
options?ExecuteOptions

Returns

Promise<string>

Inherited from

GeneratedAutomateClient.getSessionSeleniumLogs


getSessionTelemetryLogs()

getSessionTelemetryLogs(sessionId, options?): Promise<ArrayBuffer>

Defined in: openapi/generated/automate.client.ts:701

Fetches telemetry logs for a session. Telemetry logs for a session are available for tests run using Selenium 4. Telemetry logs are by default disabled for a session.

Parameters

ParameterType
sessionIdstring
options?ExecuteOptions

Returns

Promise<ArrayBuffer>

Inherited from

GeneratedAutomateClient.getSessionTelemetryLogs


recycleKey()

recycleKey(body, options?): Promise<{ newKey: string; oldKey: string; }>

Defined in: openapi/generated/automate.client.ts:531

Reset Automate access key

Parameters

ParameterType
bodynever
options?ExecuteOptions

Returns

Promise<{ newKey: string; oldKey: string; }>

Inherited from

GeneratedAutomateClient.recycleKey


updateBuild()

updateBuild(buildId, body, options?): Promise<DeepCamelCase<{ automation_build: { automation_project_id?: number; build_tag: string; created_at?: string; delta?: boolean; duration: number; framework?: string; group_id?: number; hashed_id: string; name: string; status: "done" | "running" | "timeout" | "failed"; sub_group_id?: number; test_data?: Record<string, never>; updated_at?: string; user_id?: number; }; } | { error: string; }>>

Defined in: openapi/generated/automate.client.ts:463

Update the name or tag of your build after the build is complete. To delete a build tag, simply pass an empty string as value for build_tag.

Parameters

ParameterType
buildIdstring
bodyunknown
options?ExecuteOptions

Returns

Promise<DeepCamelCase<{ automation_build: { automation_project_id?: number; build_tag: string; created_at?: string; delta?: boolean; duration: number; framework?: string; group_id?: number; hashed_id: string; name: string; status: "done" | "running" | "timeout" | "failed"; sub_group_id?: number; test_data?: Record<string, never>; updated_at?: string; user_id?: number; }; } | { error: string; }>>

Inherited from

GeneratedAutomateClient.updateBuild


updateProject()

updateProject(projectId, body, options?): Promise<{ createdAt: string; groupId: number; id: number; name: string; subGroupId: number; updatedAt: string; userId: number; }>

Defined in: openapi/generated/automate.client.ts:582

Update the name of your project after the project is complete

Parameters

ParameterType
projectIdstring
body{ name: string; }
body.namestring
options?ExecuteOptions

Returns

Promise<{ createdAt: string; groupId: number; id: number; name: string; subGroupId: number; updatedAt: string; userId: number; }>

Inherited from

GeneratedAutomateClient.updateProject


updateSession()

updateSession(sessionId, body, options?): Promise<{ appiumLogsUrl: string; browser: string; browserConsoleLogsUrl: string; browserstackStatus: string; browserUrl: string; browserVersion: string; buildName: string; createdAt: string; device?: string; duration: number; harLogsUrl: string; hashedId: string; logs: string; name: string; os: string; osVersion: string; projectName: string; publicUrl: string; realMobile?: boolean; reason: string; seleniumLogsUrl: string; seleniumTelemetryLogsUrl: string; status: "done" | "running" | "timeout" | "failed"; videoUrl: string; }>

Defined in: openapi/generated/automate.client.ts:378

Set the status for a session or update the name of the session. You can mark test status as passed or failed along with a reason.

Parameters

ParameterType
sessionIdstring
bodyDeepCamelCase<{ reason: string; status: "failed" | "passed"; } | { name: string; }>
options?ExecuteOptions

Returns

Promise<{ appiumLogsUrl: string; browser: string; browserConsoleLogsUrl: string; browserstackStatus: string; browserUrl: string; browserVersion: string; buildName: string; createdAt: string; device?: string; duration: number; harLogsUrl: string; hashedId: string; logs: string; name: string; os: string; osVersion: string; projectName: string; publicUrl: string; realMobile?: boolean; reason: string; seleniumLogsUrl: string; seleniumTelemetryLogsUrl: string; status: "done" | "running" | "timeout" | "failed"; videoUrl: string; }>

Inherited from

GeneratedAutomateClient.updateSession


uploadBuildTerminalLogs()

uploadBuildTerminalLogs(buildId, body, options?): Promise<string>

Defined in: openapi/generated/automate.client.ts:633

Upload terminal logs for your build.

Parameters

ParameterType
buildIdstring
body{ file: Blob; } | { url: string; } & object & Record<string, unknown>
options?ExecuteOptions

Returns

Promise<string>

Inherited from

GeneratedAutomateClient.uploadBuildTerminalLogs


uploadMediaFile()

uploadMediaFile(body, options?): Promise<{ mediaUrl: string; }>

Defined in: openapi/generated/automate.client.ts:514

Upload a media file you want to use in your tests

Parameters

ParameterType
body{ file: Blob; } | { url: string; } & object & Record<string, unknown>
options?ExecuteOptions

Returns

Promise<{ mediaUrl: string; }>

Inherited from

GeneratedAutomateClient.uploadMediaFile


uploadSessionTerminalLogs()

uploadSessionTerminalLogs(sessionId, body, options?): Promise<string>

Defined in: openapi/generated/automate.client.ts:327

Upload terminal logs for your session.

Parameters

ParameterType
sessionIdstring
body{ file: Blob; } | { url: string; } & object & Record<string, unknown>
options?ExecuteOptions

Returns

Promise<string>

Inherited from

GeneratedAutomateClient.uploadSessionTerminalLogs