Closed mgruner closed 7 years ago
What client binding do you use?
I use the Perl binding Selenium::Remote::Driver, latest version 1.20.
It throws an unspecific error message that I don't see in the Selenium log: Could not create new session: Unable to create a new session because of no configuration.
I'm not familiar with the perl bindings. Could you please tell me how to reproduce this? I need the name of the CPAN module to install, and a sample script to demonstrate the problem.
Hello @shs96c, of course. I believe I found the problem, and I guess this issue here can be closed. Basically I had a line in extra_capabilites
that the chrome driver does not understand, that's why it errored out.
To reproduce, you'd need to install Selenium::Remote::Driver
, e. g. via cpanm Selenium::Remote::Driver
.
Test script:
use strict;
use warnings;
use Selenium::Remote::Driver;
my $Selenium = Selenium::Remote::Driver->new(
remote_server_addr => 'localhost',
port => '4444',
browser_name => 'chrome',
platform => 'ANY',
extra_capabilities => {
marionette => \0, # Required to run FF 47 or older on Selenium 3+.
chromeOptions => {
args => ['disable-infobars'],
}
},
);
$Selenium->get('https://www.google.com');
print "Ok.\n";
As you can see, the line marionette => \0,
sneaked in from previous tests with an older Firefox. If I put this line into the chromeOptions
section, there is a meaningful error:
Could not create new session: unknown error: cannot parse capability: chromeOptions
from unknown error: unrecognized chrome option: marionette
But if it is outside, just in the extraCapabilites
like in the test script, the error is not so useful:
Could not create new session: Unable to create a new session because of no configuration.
So it generally works, once the configuration is correctly specified. It could be helpful to improve the error message though. I believe this didn't come from the Perl bindings.
Meta -
OS: Mac OS 10.11.6 (15G1611), also occurs on Linux Selenium Version: 3.5.2 Browser: Chrome, Chromium
Expected Behavior -
Works correctly in 3.4.0:
java -Dwebdriver.chrome.driver=/usr/local/bin/chromedriver -jar /usr/local/opt/selenium-server-standalone/libexec/selenium-server-standalone-3.4.0.jar
Tests run correctly with Chrome/Chromium on MacOS and on Linux.If I provide a wrong path via
-Dwebdriver.chrome.driver
, there is a meaningful exception (WARN - Exception: The driver executable does not exist: ...
)Actual Behavior -
Seems to be broken in 3.5.2:
java -Dwebdriver.chrome.driver=/usr/local/bin/chromedriver -jar /Users/martin/Downloads/selenium-server-standalone-3.5.2.jar
This starts selenium, but any attempts to create a session will fail without a meaningful error message. Further more, providing a wrong value to
-Dwebdriver.chrome.driver
leads to the same behaviour, instead of a correct error message. Here are the last log entries in the Selenium log, it seems to end suddenly:Could it be that chromedriver is not correctly located or started? Thanks for all help and advice, and please let me know if I can provide any further information.