當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Driver::start方法代碼示例

本文整理匯總了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;
 }
開發者ID:kingsj,項目名稱:core,代碼行數:32,代碼來源:Client.php

示例2: start

 /**
  * Starts the browser on the server.
  *
  * @return Browser Fluid interface
  */
 public function start()
 {
     $this->driver->start($this->type, $this->startPage);
     return $this;
 }
開發者ID:alexandresalome,項目名稱:php-selenium,代碼行數:10,代碼來源:BaseBrowser.php

示例3: start

 /**
  * Starts a session
  *
  * @return boolean
  */
 public function start()
 {
     return $this->driver->start();
 }
開發者ID:fuelphp,項目名稱:session,代碼行數:9,代碼來源:Manager.php


注:本文中的Driver::start方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。