Selenium with PHP
Your guide to running tests using PHP on BrowserStack’s Selenium Grid of 3000+ real devices and desktop browsers.
Prerequisites
- BrowserStack Username and Access key. You can find this in your account summary section. If you do not have an account yet, sign up for a Free Trial.
- Composer should be installed
Run a sample build
Here’s how you can run a sample PHP test build in three steps on BrowserStack:
Get Sample Project
Get our sample project using one of the following options:
Option 1: Download Project
Configure the test script
In order to test, you will need to configure a few parameters in the sample repository.
Set access credentials
Set userName
and accessKey
parameters in the phpunit-browserstack/config/test.conf.json
file to authenticate your tests on BrowserStack.
Configure browser or device combinations
Choose from 3000+ real mobile devices and browsers available on BrowserStack:
Copy and replace the test.conf.js
config file
Copy the adjacent config and paste it in the phpunit-browserstack/conf/test.conf.js
file within your project folder.
Execute build on BrowserStack
You are now ready to run your build on BrowserStack. From the root directory of this project, run the following command.
If the test fails, set BROWSERSTACK_USERNAME
and BROWSERSTACK_ACCESS_KEY
as environment variables on your computer and try again.
Next steps
After you have successfully run your first test on BrowserStack, try integrating your test suite with BrowserStack
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!