c# - Remote Webdriver Chrome throws a "path to the driver executable" error -
hi when use following code
iwebdriver _webdriver = new remotewebdriver(new uri("http://127.0.0.1:4444/wd/hub"), desiredcapabilities.chrome());
i follwing error
system.invalidoperationexception : path driver executable must set webdriver.chrome.driver system property; more information, see http://code.google.com/p/selenium/wiki/chromedriver. latest version can downloaded http://code.google.com/p/chromedriver/downloads/list teardown : system.nullreferenceexception : object reference not set instance of object. @ openqa.selenium.remote.remotewebdriver.unpackandthrowonerror(response errorresponse) @ openqa.selenium.remote.remotewebdriver.execute(string drivercommandtoexecute, dictionary`2 parameters) @ openqa.selenium.remote.remotewebdriver..ctor(icommandexecutor commandexecutor, icapabilities desiredcapabilities) @ testframework.browser.remotegoto(string browser, string url) in browser.cs: line 86 @ testframework.commonaction.remotebrowser(string browser) in commonaction.cs: line 70 @ test.registrationtest.invalidregistrationtest(string browser, string username, string password, string confirmpassword, string securityquestion, string securityanswer, string errormessagetext, string firstname, string lastname) in registrationtest.cs: line 50 --teardown @ testframework.commonaction.capturescreen(string filename) in commonaction.cs: line 121 @ test.registrationtest.snapshotonfailure() in registrationtest.cs: line 590
the clue in error.
chrome should installed on system tests either running on or being pointed to.
take step back, @ documentation:
https://code.google.com/p/selenium/wiki/chromedriver
also, if chrome installed in peculiar place, you'll need point selenium it's location. again, explained in documentation.
in c#:
desiredcapabilities capabilities = desiredcapabilities.chrome(); capabilities.setcapability("chrome.binary", this.binarylocation);
or:
chromeoptions options = new chromeoptions(); options.binarylocation = "pathtogooglechrome"; capabilities.setcapability(chromeoptions.capability, options);
Comments
Post a Comment