> For the complete documentation index, see [llms.txt](https://developer.harness.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developer.harness.io/continuous-integration/3.0/troubleshooting-and-resources/tutorials-and-code-samples/browser/browserstack.md).

# BrowserStack

[BrowserStack](https://www.browserstack.com/) is a cloud web and mobile testing platform that provides developers with the ability to test their websites and mobile applications across on-demand browsers, operating systems and real mobile devices.

### BrowserStack Automate <a href="#browserstack-automate" id="browserstack-automate"></a>

[BrowserStack Automate](https://www.browserstack.com/automate-product) runs your Selenium tests on an extensive list of browsers and mobile devices, with support for CI and Local Testing.

The [Integrate BrowserStack Automate with Harness](https://www.browserstack.com/docs/automate/selenium/harness) guide from BrowserStack covers the following topics:

1. Set up a pipeline in Harness
2. Integrate existing test cases
3. Integrate test cases for locally hosted websites

{% hint style="info" %}
When running BrowserStack tests on [Kubernetes infrastructure](/continuous-integration/3.0/use-harness-ci/use-harness-ci/set-up-build-infrastructure/k8s-build-infrastructure/set-up-a-kubernetes-cluster-build-infrastructure.md), set the appropriate [resource limits](/continuous-integration/3.0/use-harness-ci/use-harness-ci/set-up-build-infrastructure/resource-limits.md) required by your steps.
{% endhint %}

Here is an example of a BrowserStack Automate step in a Harness pipeline, where the access key has been added to the project as a [text secret](/harness-ai/use-harness-platform/secrets/add-use-text-secrets.md) named `browserstack_access_key`.

```yaml
              - step:
                  type: Run
                  name: BrowserStack Automate
                  identifier: browserstack_automate
                  spec:
                    shell: Sh
                    command: |
                      wget "https://www.browserstack.com/browserstack-local/BrowserStackLocal-linux-x64.zip"
                      unzip BrowserStackLocal-linux-x64.zip
                      ./BrowserStackLocal --key $BROWSERSTACK_ACCESS_KEY --daemon start
                      <your-test-command>
                      ./BrowserStackLocal --key $BROWSERSTACK_ACCESS_KEY --daemon stop
                    envVariables:
                      BROWSERSTACK_USERNAME: browserstack_username
                      BROWSERSTACK_ACCESS_KEY: <+secrets.getValue("browserstack_access_key")>
```
