To enable chrome console loging when browser is started by chrome drive
the "chrome_debug.log" file in User Data is empty
// You can insert your PHP code here (or remove this block if it is not relevant for the issue).
call : url_setopt($curl, CURLOPT_POSTFIELDS, json_encode($parameters));
with
{"desiredCapabilities":{"tags":["CPI","PHP 5.6.32"],"browser":"firefox","ignoreZoomSetting":false,"name":"Behat feature suite","chrome.switches":["--enable-logging","--v=4"],"chrome.extensions":[],"chromeOptions":{"args":["--enable-logging","--v=4"],"extensions":[]},"browserName":"chrome"}}
or
The capabilities "parameters" values are set in a behat config file. Is this the correct format? The curl_setopt return TRUE.
Just as an observation.....
After a lot of effort debugging and comparing with the "official" Java WebDriver suite, I see that this PHP WebDriver implements none of the Logging preference classes.
With the Chrome Driver, you can access the browser's Console Log by using the non-standard setCapabilities call:
$chromeCapabilities->setCapability( 'loggingPrefs', ['browser' => 'ALL'] );
Then, a call to
$chromeDriver->manage()->getLog( 'browser' )
returns the console log.
Most helpful comment
Just as an observation.....
After a lot of effort debugging and comparing with the "official" Java WebDriver suite, I see that this PHP WebDriver implements none of the Logging preference classes.
With the Chrome Driver, you can access the browser's Console Log by using the non-standard setCapabilities call:
$chromeCapabilities->setCapability( 'loggingPrefs', ['browser' => 'ALL'] );Then, a call to
$chromeDriver->manage()->getLog( 'browser' )returns the console log.