PHP selenium automation sample test for Lambdatest Cloud GRID.
- Download & Install PHP from http://php.net/manual/en/install.php
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
php -r "if (hash_file('sha384', 'composer-setup.php') === '93b54496392c062774670ac18b134c3b3a95e5a5e5c8f1a9f115f203b75bf9a129d5daa8ba6a13e2cc8a1da0806388a8') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
php composer-setup.php
php -r "unlink('composer-setup.php');"
- Create composer.json file with following dependencies
{
"require": {
"phpunit/phpunit-selenium": "*",
"facebook/webdriver": "dev-master"
}
}
- Install dependencies
composer install
- Set LambdaTest username and access key in environment variables. It can be obtained from LambdaTest dashboard
For Linux/Mac
export LT_USERNAME="YOUR_USERNAME"
export LT_ACCESS_KEY="YOUR ACCESS KEY"
For Windows
set LT_USERNAME="YOUR_USERNAME"
set LT_ACCESS_KEY="YOUR ACCESS KEY"
- Replace {username} with your username
- Replace {accessToken} with your accessKey
- List of supported platfrom, browser, version can be found at https://www.lambdatest.com/capabilities-generator/
php Lambdatest.php
LambdaTest is a cloud based selenium grid infrastructure that can help you run automated cross browser compatibility tests on 2000+ different browser and operating system environments. LambdaTest supports all programming languages and frameworks that are supported with Selenium, and have easy integrations with all popular CI/CD platforms. It's a perfect solution to bring your selenium automation testing to cloud based infrastructure that not only helps you increase your test coverage over multiple desktop and mobile browsers, but also allows you to cut down your test execution time by running tests on parallel.