This is a legacy Python SDK for integrating Selenium-webdriver tests with BrowserStack. It is officially deprecated and no longer actively maintained. BrowserStack now recommends using standard Selenium with BrowserStack capabilities directly. The last release of this SDK was 1.45.0 in April 2022.
pip install browserstack-sdkVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how the deprecated `browserstack-sdk` was typically used for setting up BrowserStack Local testing with Selenium. It is provided for historical context and to highlight functionality unique to the SDK. For new projects, it is highly recommended to follow the official BrowserStack documentation for setting up Selenium tests without this SDK.
Migrate your tests to directly use `selenium.webdriver.Remote` and configure BrowserStack capabilities (e.g., `bstack:options`) as described in the official BrowserStack documentation (https://www.browserstack.com/docs/automate/selenium/python/getting-started).
Refer to the official BrowserStack documentation for up-to-date best practices for Python and Selenium integration, which provide current and maintained solutions.
Consult the BrowserStack documentation on local testing with Python and Selenium for the current setup instructions, which typically do not involve programmatic control from this specific SDK.
If you intend to use the legacy SDK (not recommended), run `pip install browserstack-sdk`. Otherwise, remove all imports related to `browserstack-sdk` (e.g., `from browserstack.local import Local`) and rewrite your test using standard `selenium` methods with direct capability configuration.
Verify `BROWSERSTACK_USERNAME` and `BROWSERSTACK_ACCESS_KEY` environment variables (or hardcoded values) are correct. Ensure your specified browser and OS capabilities are valid and supported by BrowserStack. If using local testing, verify the BrowserStack Local service is running and configured correctly according to the *latest* BrowserStack documentation, not the SDK's old methods.
If you are migrating away from the deprecated SDK, replace such SDK-specific calls with standard Selenium WebDriver methods or direct BrowserStack capability settings. If you *must* use the SDK, ensure you are calling methods correctly as per its original documentation and that you are using the correct WebDriver instance that the SDK might have wrapped.