Integrate your test suite with BrowserStack
BrowserStack supports a plug-and-play integration. Run your entire test suite in parallel in a few steps!
Prerequisites
Before you begin, ensure you have:
- Ruby v3.0 or higher
- RSpec 3.x or higher
- Cucumber 6.x or higher
- Selenium WebDriver 3.x or 4.x
Integration steps
Configure browserstack.yml
Create a browserstack.yml file in your project root to store BrowserStack credentials, target platforms, and feature flags:
Use a configuration similar to the following:
Integrate the SDK with your test framework
Hook the BrowserStack Ruby SDK into your RSpec and Cucumber test lifecycles so it can capture and report test execution:
For RSpec, ensure your spec_helper.rb or rails_helper.rb requires the SDK:
For Cucumber, require the SDK in features/support/env.rb so it can track scenarios and steps:
Run your test suite
Run your tests with the following commands. The BrowserStack SDK intercepts Selenium WebDriver sessions and routes them to BrowserStack:
To run your RSpec suite with BrowserStack integration enabled, run RSpec as you normally do:
To run your Cucumber scenarios, use the BrowserStack SDK wrapper so that the SDK can intercept sessions and send results to BrowserStack:
After the run completes, review your sessions, accessibility scans, and observability data in the BrowserStack dashboard.
Advanced features and use cases
Here’s a list of features and capabilities you may find useful.
Accept insecure certificates
The acceptInsecureCerts capability suppresses browser popups warning about self-signed certificates usually found in staging environments.
| Capability | Expected values |
|---|---|
acceptInsecureCerts |
A boolean. Default is False.True if you want to accept all SSL certificates. |
Change desktop resolution
The resolution capability changes the default desktop screen resolution for your tests on BrowserStack.
| Capability | Description | Expected values |
|---|---|---|
resolution |
Set the resolution of your VM before beginning your test | A string. Default resolution is 1024x768 Supported resolutions: Windows (XP, 7): 800x600, 1024x768, 1280x800, 1280x1024, 1366x768, 1440x900, 1680x1050, 1600x1200, 1920x1200, 1920x1080, and 2048x1536 Windows (8, 8.1, 10): 1024x768, 1280x800, 1280x1024, 1366x768, 1440x900, 1680x1050, 1600x1200, 1920x1200, 1920x1080, and 2048x1536 OS X (Sequoia, Sonoma, Ventura, Monterey, Big Sur, Catalina, Mojave, and High Sierra): 1024x768, 1280x960, 1280x1024, 1600x1200, 1920x1080, 2560x1440, 2560x1600, and 3840x2160 OS X (All other versions): 1024x768, 1280x960, 1280x1024, 1600x1200, and 1920x1080
|
Simulate IP geolocation
The geoLocation capability lets you test your websites across different countries.
Note that this capability is supported on the Enterprise plan only. You can contact sales to get an Enterprise plan for your account.
| Capability | Description | Expected values |
|---|---|---|
geoLocation |
Set the country code you want your test to detect | A string. An ISO 2 country code FR for France, CN for China Check out the complete list of 45+ countries we support. |
Simulate network conditions
The networkProfile capability lets you test your websites under different network conditions.
| Capability | Description | Expected values |
|---|---|---|
networkProfile |
Set the network profile to start the test with | A string. 2g-gprs-good, 4g-lte-advanced-lossy Check out the complete list of all pre-defined network profiles. |
Others
Following are a few additional links to documentation pages that might help with your test scenarios:
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
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!