Skip to main content
🚀 Self Healing AI Agent now live in App Automate! Auto-fix flaky tests instantly with zero code changes. Enable now!
No Result Found
Connect & Get help from fellow developers on our Discord community. Ask the CommunityAsk the Community

WebDriverIO BrowserStack service on App Automate

A WebdriverIO service for BrowserStack App Automate users, enabling testing on 3,000+ real devices with support for local testing and test analytics.

The WebdriverIO BrowserStack Service enables seamless integration between WebdriverIO and BrowserStack, allowing you to run tests across real devices and browsers at scale. This guide walks you through the setup, configuration, and key options needed to run automated tests using BrowserStack’s cloud infrastructure, including support for local testing and test observability features.

BrowserStack credentials

Ensure you have set your BrowserStack credentials as environment variables.

export BROWSERSTACK_USERNAME="YOUR_USERNAME"
export BROWSERSTACK_ACCESS_KEY="YOUR_ACCESS_KEY"

Configuration​

Add your BrowserStack service settings to wdio.conf.js. Here is an example configuration file to help you get started with:

wdio.conf.js
Copy icon Copy

Options​

The following table lists the supported WebDriverIO BrowserStack (wdio.conf.js) capabilities and how they must be defined in the configuration file:

Capability Description Example usage in wdio.conf.js
browserName Specify the browser name to run the test on browserName: ‘chrome’
browserVersion Define the version of the browser browserVersion: ‘latest’
os Operating system to run tests on ‘bstack:options’: { os: ‘Windows’ }
osVersion Version of the operating system ‘bstack:options’: { osVersion: ‘10’ }
deviceName Specify the device for mobile testing ‘bstack:options’: { deviceName: ‘Samsung Galaxy S20’ }
buildName Custom build name for your test run ‘bstack:options’: { buildName: ‘My Build’ }
projectName Custom project name ‘bstack:options’: { projectName: ‘My Project’ }
source Identifier for the framework and version used ‘bstack:options’: { source: ‘webdriverio:my-app:v1.0’ }
networkLogs Enable network logs ‘bstack:options’: { networkLogs: true }
consoleLogs Set console log level ‘bstack:options’: { consoleLogs: ‘info’ }
debug Enable debugging mode ‘bstack:options’: { debug: true }
idleTimeout Timeout in seconds before ending an idle session ‘bstack:options’: { idleTimeout: 90 }
seleniumLogs Enable Selenium logs ‘bstack:options’: { seleniumLogs: true }
buildIdentifier Placeholder for CI build number buildIdentifier: ‘#${BUILD_NUMBER}’
app App path or URL (used in App Automate) app: ‘bs://'
browserstackLocal Enable Local Testing browserstackLocal: true
opts.forceLocal Force local testing even when external connection is available opts: { forceLocal: true }
opts.localIdentifier Identifier for your local instance opts: { localIdentifier: ‘my-local’ }
forcedStop Force stop Local binary forcedStop: false
sessionNameFormat Format for test session names sessionNameFormat: (config, capabilities) => { return ‘My Test’; }
sessionNamePrependTopLevelSuiteTitle Prepend top-level suite title to session name sessionNamePrependTopLevelSuiteTitle: true
sessionNameOmitTestTitle Omit test title from session name sessionNameOmitTestTitle: true
skipSessionStatus Skip automatic session status reporting skipSessionStatus: true
preferScenarioName Prefer scenario name for session naming preferScenarioName: true
skipSessionName Skip setting session name skipSessionName: true
testObservabilityOptions.buildName Build name used for observability tracking testObservabilityOptions: { buildName: ‘My Build’ }
testObservabilityOptions.projectName Project name used for observability tracking testObservabilityOptions: { projectName: ‘My Project’ }
testObservabilityOptions.buildTag Tags to categorize your build testObservabilityOptions: { buildTag: [‘tag1’, ‘tag2’] }
accessibility Enable accessibility testing accessibility: true
accessibilityOptions.wcagVersion WCAG version to use for compliance checks accessibilityOptions: { wcagVersion: ‘wcag21a’ }
accessibilityOptions.includeIssueType.bestPractice Include best practice issues in the report includeIssueType: { bestPractice: true }
accessibilityOptions.includeIssueType.needsReview Include review-needed issues in the report includeIssueType: { needsReview: false }
accessibilityOptions.includeTagsInTestingScope Tags to include in accessibility scan includeTagsInTestingScope: [‘First’]
accessibilityOptions.excludeTagsInTestingScope Tags to exclude from accessibility scan excludeTagsInTestingScope: [‘Twice’]
percy Enable Percy for visual testing percy: false
percyCaptureMode Percy capture mode percyCaptureMode: ‘auto’
turboscale Enable TurboScale optimization turboscale: false

We're sorry to hear that. Please share your feedback so we can do better

Contact our Support team for immediate help while we work on improving our docs.

We're continuously improving our docs. We'd love to know what you liked





Thank you for your valuable feedback

Is this page helping you?

Yes
No

We're sorry to hear that. Please share your feedback so we can do better

Contact our Support team for immediate help while we work on improving our docs.

We're continuously improving our docs. We'd love to know what you liked





Thank you for your valuable feedback!

Talk to an Expert
Download Copy Check Circle