Php-webdriver: enable chrome console log

Created on 14 May 2018  路  1Comment  路  Source: php-webdriver/php-webdriver

What are you trying to achieve? (Expected behavior)

To enable chrome console loging when browser is started by chrome drive

What do you get instead? (Actual behavior)

the "chrome_debug.log" file in User Data is empty

How could the issue be reproduced? (Steps to reproduce)

// 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

Details

  • Php-webdriver version:
  • PHP version: 5.6.32
  • Selenium server version: 3.3.1
  • Operating system: Windows 8
  • Browser used + version: Chrome latest

The capabilities "parameters" values are set in a behat config file. Is this the correct format? The curl_setopt return TRUE.

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.

>All comments

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.

Was this page helpful?
0 / 5 - 0 ratings