https://github.com/browserstack/behave-browserstack
Selenium examples for Behave and BrowserStack Automate
https://github.com/browserstack/behave-browserstack
Last synced: 11 months ago
JSON representation
Selenium examples for Behave and BrowserStack Automate
- Host: GitHub
- URL: https://github.com/browserstack/behave-browserstack
- Owner: browserstack
- Created: 2016-04-06T06:46:19.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2024-07-03T15:30:19.000Z (over 1 year ago)
- Last Synced: 2025-04-22T21:07:41.213Z (11 months ago)
- Language: Python
- Homepage: https://www.browserstack.com
- Size: 39.1 KB
- Stars: 14
- Watchers: 17
- Forks: 29
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# behave-browserstack
[Behave](https://github.com/behave/behave) Integration with BrowserStack.

## Prerequisite
```
python3 should be installed
```
## Setup
* Clone the repo
```
git clone -b sdk https://github.com/browserstack/behave-browserstack.git
```
* It is recommended to use a virtual environment to install dependencies. To create a virtual environment:
```
python3 -m venv env
source env/bin/activate # on Mac/Linux
env\Scripts\activate # on Windows
```
* Install dependencies
```
pip install -r requirements.txt
```
## Set BrowserStack Credentials
* Add your BrowserStack username and access key in the `browserstack.yml` config fle.
* You can also export them as environment variables, `BROWSERSTACK_USERNAME` and `BROWSERSTACK_ACCESS_KEY`:
#### For Linux/MacOS
```
export BROWSERSTACK_USERNAME=
export BROWSERSTACK_ACCESS_KEY=
```
#### For Windows
```
set BROWSERSTACK_USERNAME=
set BROWSERSTACK_ACCESS_KEY=
setx BROWSERSTACK_USERNAME=
setx BROWSERSTACK_ACCESS_KEY=
```
## Running tests
* To run sample tests:
- To run the sample tests in parallel across the platforms defined in the `browserstack.yml` file, run:
```
browserstack-sdk behave features/test.feature
```
* To run tests on locally hosted websites:
- To run the local test in parallel across the platforms defined in the `browserstack.yml` file, run:
```
browserstack-sdk behave features/local-test.feature
```
## Notes
* You can view your test results on the [BrowserStack Automate dashboard](https://www.browserstack.com/automate)
* To test on a different set of browsers, check out our [platform configurator](https://www.browserstack.com/docs/automate/selenium/sdk-config-generator)
* Understand how many parallel sessions you need by using our [Parallel Test Calculator](https://www.browserstack.com/automate/parallel-calculator?ref=github)
## Additional Resources
* [Documentation for writing Automate test scripts in Python](https://www.browserstack.com/automate/python)
* [Customizing your tests on BrowserStack](https://www.browserstack.com/automate/capabilities)
* [Browsers & mobile devices for selenium testing on BrowserStack](https://www.browserstack.com/list-of-browsers-and-platforms?product=automate)
* [Using REST API to access information about your tests via the command-line interface](https://www.browserstack.com/automate/rest-api)