Skip to main content
No Result Found
Get your setup working faster. Join our Discord for optimisation tips from elite testers. Join our DiscordJoin our Discord

Test Reporting & Analytics on Pytest

Quick start guide to integrate BrowserStack Test Reporting & Analytics with Pytest.

Prerequisites

Following are the prerequisites to use Test Reporting & Analytics with Pytest:

  • You have a Pytest (v4.2.0 or higher) 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 Reporting & Analytics

You can use BrowserStack Test Reporting & Analytics 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 Reporting & Analytics is agnostic to the type of testing and hence you could also integrate it with your unit or integration test suite written using Pytest.

Please select your setup below to get started with an awesome debugging experience with Test Reporting & Analytics:

Install the latest SDK version

Go to your Pytest 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


Ensure that you have at least browserstack-sdk v1.17.4 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

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 Reporting & Analytics 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 Reporting & Analytics

Prepend browserstack-sdk to the command you use to run your test. For example, if you use the command pytest <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


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

Visit Test Reporting & Analytics

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