public function start() { $seleniumUrl = $this->seleniumOptions->getSeleniumUrl(); $seleniumQuery = $this->seleniumOptions->getSeleniumQuery(); $seleniumJarLocation = $this->seleniumOptions->getSeleniumJarLocation(); if (!$seleniumUrl || !$seleniumQuery || !$seleniumJarLocation) { throw new \LogicException('Url, Query and Selenium Jar Location is mandatory and Jar Location should point to a .jar file.'); } if (!is_file($seleniumJarLocation)) { throw new \RuntimeException('Selenium jar is not a file'); } if (!is_readable($seleniumJarLocation)) { throw new \RuntimeException('Selenium jar not readable - ' . $seleniumJarLocation); } if ($this->isSeleniumAvailable()) { throw new \RuntimeException('Selenium was already started'); } $this->setStartCommand($this->createStartCommand()); $this->process->setCommandLine($this->getStartCommand()); $this->process->start(); $this->responseWaitter->waitUntilAvailable($seleniumUrl, $seleniumQuery); }