Code samples for php selenium tests on browserstack.
phpandcomposershould be installed in your system.
- If you don't already use Composer, you can download the composer.phar binary:
curl -sS https://getcomposer.org/installer | php
- Clone the repo
git clone https://github.com/browserstack/php-selenium-browserstack.git
- Install dependencies
php composer.phar install
- Set your credentials in the
config.phpfile. UpdateYOUR_USERNAMEandYOUR_ACCESS_KEYwith your username and access key. You can also set them as environment variablesBROWSERSTACK_USERNAMEandBROWSERSTACK_ACCESS_KEY, as follows:
- For Unix-like or Mac machines:
export BROWSERSTACK_USERNAME=<browserstack-username> &&
export BROWSERSTACK_ACCESS_KEY=<browserstack-access-key>
- For Windows:
set BROWSERSTACK_USERNAME=<browserstack-username>
set BROWSERSTACK_ACCESS_KEY=<browserstack-access-key>
Run single test session by running.
php scripts/single.php
Run parallel test session by running.
php scripts/parallel.php
Run local test session by running.
php scripts/local.php