DataSift\Storyplayer\PlayerLib\StoryTeller::getRunningDevice PHP Method

getRunningDevice() public method

public getRunningDevice ( ) : DataSift\WebDriver\WebDriverSession
return DataSift\WebDriver\WebDriverSession
    public function getRunningDevice()
    {
        if (!is_object($this->deviceAdapter)) {
            $this->startDevice();
        }
        if (!is_object($this->deviceAdapter)) {
            throw new E5xx_CannotStartDevice();
        }
        return $this->deviceAdapter->getDevice();
    }

Usage Example

Esempio n. 1
0
 protected function initDevice()
 {
     // start the test device
     $this->device = $this->st->getRunningDevice();
     // set our top XPATH node
     //
     // for the moment, we are assuming that the test device is
     // a web browser, because historically this has always been
     // the case
     //
     // when this assumption is no longer valid, we will need to
     // revisit this code
     $this->setTopXpath("//html");
     // set our top element
     //
     // we cannot assume that the browser has any DOM loaded at all
     $this->setTopElement($this->device);
 }