Skip to main content
No Result Found

Test Observability on Behave

Quick start guide to integrate BrowserStack Test Observability with Behave.

Prerequisites

Following are the prerequisites to use Test Observability with Behave:

  • You have a Behave (v1.2.6 or later) test suite.
  • You may run your tests on BrowserStack Automate or even on any other cloud provider or even locally.
  • Your tests can be unit / integration / functional or of any nature.

Integrate with Test Observability

You can use BrowserStack Test Observability both when you’re using BrowserStack’s devices and browsers to run your functional end-to-end tests and also if you’re running tests locally on your laptop/CI system or even when you’re using some other cloud provider.

Not only that, Test Observability is agnostic to the type of testing and hence you could also integrate it with your unit or integration test suite written using Behave.

Please select your setup below to get started with an awesome debugging experience with Test Observability:

Install the latest SDK version

Go to your Behave project’s root directory and run the following commands to update or install the BrowserStack SDK, set it up using your credentials, and verify the installed version:

Terminal
Copy icon Copy
python3 -m pip install browserstack-sdk
browserstack-sdk setup --framework "behave" --username "YOUR_USERNAME" --key "YOUR_ACCESS_KEY"
pip show browserstack-sdk


Ensure that you have at least browserstack-sdk v1.21.0 before proceeding.

Modify your browserstack.yml config file

After installing the SDK, a browserstack.yml config file will be created at the root level of your project. This file holds all the required capabilities to run tests on BrowserStack.

Copy the contents of the following config file and set it in your project’s browserstack.yml file:

browserstack.yml
Copy icon Copy
userName: YOUR_USERNAME
accessKey: YOUR_ACCESS_KEY
buildName: "Your static build/job name goes here"
projectName: "Your static project name goes here"
CUSTOM_TAG_1: "You can set a custom Build Tag here"
# Use CUSTOM_TAG_<N> and set more build tags as you need.
framework: behave
testObservability: true
browserstackAutomation: false # Set to true for tests on BrowserStack products.

The projectName and buildName config must be static and not change across different runs of the same build. This is a deviation in approach as specified by BrowserStack Automate or App Automate as Test Observability will automatically identify different build runs.

Restrict the characters in your projectName and buildName to alphanumeric characters (A-Z, a-z, 0-9), underscores (_), colons (:), and hyphens (-). Any other character will be replaced with a space.

Run your test suite with Test Observability

Prepend browserstack-sdk to the command you use to run your test. For example, if you use the command behave <path-to-test-file> to run your test suite, you can run the following command from your project’s root directory to run your test suite with BrowserStack:

Terminal
Copy icon Copy
browserstack-sdk behave <path-to-test-files>


Post build run completion, you’ll be able to see the build run report along with all necessary debugging information.

Visit Test Observability

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