PHP code example of browserstack / browserstack-local

1. Go to this page and download the library: Download browserstack/browserstack-local library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

browserstack / browserstack-local example snippets



use BrowserStack\Local;

#creates an instance of Local
$bs_local = new Local();

#replace <browserstack-accesskey> with your key. You can also set an environment variable - "BROWSERSTACK_ACCESS_KEY".
$bs_local_args = array("key" => "<browserstack-accesskey>");

#starts the Local instance with the 

$bs_local_args = array("key" => "<browserstack-accesskey>", "v" => true);

$bs_local_args = array("key" => "<browserstack-accesskey>", "force" => true);

$bs_local_args = array("key" => "<browserstack-accesskey>", "onlyAutomate" => true);

$bs_local_args = array("key" => "<browserstack-accesskey>", "forcelocal" => true);

$bs_local_args = array("key" => "<browserstack-accesskey>", "-pac-file" => "<pac_file_abs_path>");

$bs_local_args = array("key" => "<browserstack-accesskey>", "localIdentifier" => "randomstring");

$bs_local_args = array("key" => "<browserstack-accesskey>", "binarypath" => "/browserstack/BrowserStackLocal");

$bs_local_args = array("key" => "<browserstack-accesskey>", "logfile" => "/browserstack/logs.txt");