Skip to content

Commit

Permalink
Driver: Option for seconds to wait in between attempts at BrowserStack
Browse files Browse the repository at this point in the history
  • Loading branch information
chibimagic committed Apr 17, 2015
1 parent 6c3795b commit 9864e7a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions WebDriver.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ class WebDriver {
public static $CurlTimeoutSec = 120; // How long to wait for the server's response to any single command
public static $BrowserStackMaxAttempts = 100; // Maximum number of times to try to start a session at BrowserStack
public static $BrowserStackMaxSeconds = 120; // Maximum number of seconds to try to start a session at BrowserStack
public static $BrowserStackWaitSeconds = 5; // Seconds to wait in between attempts to start a session at BrowserStack

// See http://code.google.com/p/selenium/wiki/JsonWireProtocol#/session/:sessionId/element/:id/value
// Example: $my_web_element->send_keys(WebDriver::ReturnKey());
Expand Down
2 changes: 1 addition & 1 deletion WebDriver/Driver.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ public static function InitAtBrowserStack($browserstack_username, $browserstack_
} catch (WebDriver_OverParallelLimitException $e) {
PHPUnit_Framework_Assert::assertTrue(time() < $starting_time + WebDriver::$BrowserStackMaxSeconds);
PHPUnit_Framework_Assert::assertTrue($attempt < WebDriver::$BrowserStackMaxAttempts);
sleep(1);
sleep(WebDriver::$BrowserStackWaitSeconds);
return WebDriver_Driver::InitAtBrowserStack($browserstack_username, $browserstack_value, $os, $browser, $version, $additional_options, $starting_time, $attempt + 1);
}
}
Expand Down

0 comments on commit 9864e7a

Please sign in to comment.