From 9864e7ad3f691e1fdf201d2fb98156ce87171f0f Mon Sep 17 00:00:00 2001 From: chibimagic Date: Thu, 16 Apr 2015 17:50:51 -0700 Subject: [PATCH] Driver: Option for seconds to wait in between attempts at BrowserStack --- WebDriver.php | 1 + WebDriver/Driver.php | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/WebDriver.php b/WebDriver.php index 00e6d0b..a063d89 100644 --- a/WebDriver.php +++ b/WebDriver.php @@ -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()); diff --git a/WebDriver/Driver.php b/WebDriver/Driver.php index 5c8b3f4..3e8c413 100644 --- a/WebDriver/Driver.php +++ b/WebDriver/Driver.php @@ -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); } }