Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Start chrome without the selenium standalone server. #647
I've gone through the doc for facebook webdriver, please note I'm using latest version of everything including facebook/webdriver, chromedriver, selenium. This is what written in the doc:
You can find more information and download ChromeDriver in https://code.google.com/p/selenium/wiki/ChromeDriver. After downloading the chrome driver, we can start chrome without the selenium standalone server.
So I tried using headless mode to run chrome, here is my code:
as I can see chrome is running in background but then closes by iteself, and error that I'm getting is:
I know that you will say that you need to run selenium standalone, but I don't want to run it, as I want to run chrome without selenium to make automation. Please let me know.
$host = 'http://localhost:9515';
You can use Symfony's
use Symfony\Component\Process\Process; $process = new Process(__DIR__.'/chromedriver.exe'); $process->start(); $host = 'http://localhost:9515'; $options = new ChromeOptions(); $options->addArguments(array( '--headless', '--window-size=1280x800', '--disable-gpu', '--no-sandbox' )); $capabilities = DesiredCapabilities::chrome(); $capabilities->setCapability(ChromeOptions::CAPABILITY, $options); $driver = RemoteWebDriver::create($host, $capabilities, 5000); $driver->get('https://web.chayenu.org/'); $driver->close(); $process->stop();