selenium - Difference between webdriver.firefox.marionette & webdriver.gecko.driver -
i learning selenium , have met problem.
i aware selenium supported old firefox version default without driver. , recent versions of firefox, have download driver , define using system.setproperty
.
according link, firefox 45 , 46, start driver code this:
webdriver driver = new firefoxdriver();
my firefox version 45.5.1., above code still won't work. according link, have added
system.setproperty("webdriver.firefox.marionette","c:\\geckodriver.exe");
and worked.
then realized haven't installed geckodriver.exe
on computer. see how goes, have changed code below.
system.setproperty("webdriver.firefox.marionette","");
it still works.
so, here comes first problem: happened? sure no geckodriver.exe
exists on environment. if no location has been pointed, why should have set property?
also, have seen code
system.setproperty("webdriver.gecko.driver", "/tools/marionette/wires.exe");
my second question difference between webdriver.gecko.driver
, webdriver.firefox.marionette
or wires.exe
and geckodriver.exe
?
up version 45 (pushed version 47), driver used automate firefox extension included each client. extension dropped, due change of policy requires extensions signed mozilla.
marionette new driver shipped/included firefox. driver has it's own protocol not directly compatible selenium/webdriver protocol.
the gecko driver (previously named wires) application server implementing selenium/webdriver protocol. translates selenium commands , forwards them marionette driver.
for java client, default behavior use gecko driver, can overridden use legacy extension driver webdriver.firefox.marionette
property:
system.setproperty("webdriver.firefox.marionette", "false");
or marionette
capability through firefoxoptions
:
firefoxoptions options = new firefoxoptions() .setlegacy(true); webdriver driver = new firefoxdriver(options); // or remote server webdriver driver = new remotewebdriver(remoteurl, options.todesiredcapabilities());
or directly desiredcapabilities
:
desiredcapabilities capa = desiredcapabilities.firefox(); capa.setcapability("marionette", false); webdriver driver = new firefoxdriver(capa); // or remote server webdriver driver = new remotewebdriver(remoteurl, capa);
and define location of gecko driver, either place driver in folder present in path
environment variable, or define location in property webdriver.gecko.driver
:
system.setproperty("webdriver.gecko.driver", "c:\\geckodriver.exe");
or launch remote server property assigned in command line:
java -dwebdriver.gecko.driver="c:\\geckodriver.exe" -jar selenium-server-standalone-3.4.0.jar
Comments
Post a Comment