本文整理匯總了PHP中Driver::start方法的典型用法代碼示例。如果您正苦於以下問題:PHP Driver::start方法的具體用法?PHP Driver::start怎麽用?PHP Driver::start使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Driver
的用法示例。
在下文中一共展示了Driver::start方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: start
/**
* Start Sahi browser session.
*
* @param string $browserName (firefox, ie, safari, chrome, opera)
*/
public function start($browserName = null)
{
if ($this->started) {
throw new Exception\ConnectionException('Client is already started');
}
if (!$this->con->isProxyStarted()) {
throw new Exception\ConnectionException('Sahi proxy seems not running');
}
// open browser if connection uses custom SID (not defaultly autogenerated)
if (!$this->con->isCustomSidProvided()) {
if (null === $browserName) {
throw new \InvalidArgumentException('Specify browser to run in');
}
$this->con->start($browserName);
$limit = 600;
while (!$this->con->isReady()) {
usleep(100000);
if (--$limit <= 0) {
throw new Exception\ConnectionException('Connection time limit reached');
}
}
$this->browserAutoruned = true;
} elseif (!$this->con->isReady()) {
throw new Exception\ConnectionException(sprintf("Can not connect to Sahi session with id \"%s\".\n" . "Start Sahi session in target browser by opening:\n" . "http://sahi.example.com/_s_/dyn/Driver_start?sahisid=%s&startUrl=http://sahi.example.com/_s_/dyn/Driver_initialized", $this->con->getSid(), $this->con->getSid()));
}
$this->started = true;
}
示例2: start
/**
* Starts the browser on the server.
*
* @return Browser Fluid interface
*/
public function start()
{
$this->driver->start($this->type, $this->startPage);
return $this;
}
示例3: start
/**
* Starts a session
*
* @return boolean
*/
public function start()
{
return $this->driver->start();
}