Selenium use local server as RemoteWebdriver -


i encountered problem selenium. created selenium test remotewebdriver class test can run in remote machine runs selenium-standalone-server (v3.4).

and ran standalone server in local , change url remotewebdriver localhost, connection created got exception:

org.openqa.selenium.webdriverexception: path driver executable must set webdriver.gecko.driver system property; more information, see https://github.com/mozilla/geckodriver. latest version can downloaded https://github.com/mozilla/geckodriver/releases

i did specify driver in code following:

system.setproperty("webdriver.gecko.driver", path_to_the_driver); 

the driver path specified in server existed. tried every method can find , still doesn't work. although use firefoxdriver, still want know why problem occurred.

i'd appreciate idea this. thanks!

you need specify not in code when launching selenium server jar

java -dwebdriver.gecko.driver=/usr/drivers/geckodriver-v0.18.0 -jar selenium-server-standalone-3.5.1.jar -port 4444 

edit-1

the reason when specify driver in local code, used launch browser locally. in case asking selenium hub/grid launch browser. server needs know driver located.

in case local java process knows location not server java process. why need use server launch


Comments

Popular posts from this blog

Is there a better way to structure post methods in Class Based Views -

performance - Why is XCHG reg, reg a 3 micro-op instruction on modern Intel architectures? -

jquery - Responsive Navbar with Sub Navbar -