Capabilities error after using selenium grid and Webdriver manager -
i have been using [webdriver manager][1] local executions, has been outstanding, right i'm trying use selenium grid , use same approach i'm getting errors related capabilities.
the hub , node localhost, these details of implementation:
i'm starting hub line:
start cmd /k java -jar selenium-server-standalone-3.5.0.jar -role hub -port 4443
i'm starting node line
start cmd /k java -jar selenium-server-standalone-3.5.0.jar -port 5556 -role node -hub http://localhost:4443/grid/register
this configuration i'm using browsers, problem chrome, haven't tested other ones yet.
public webdriver cbt(string browser, string methodname) throws exception{ webdriver driver; desiredcapabilities caps; //check if parameter passed testng 'firefox' if(browser.equalsignorecase("firefox")) { caps = desiredcapabilities.firefox(); caps.setcapability("platform", "windows 10"); caps.setcapability("version", "53.0"); caps.setcapability("name", methodname); } //check if parameter passed 'chrome' else if(browser.equalsignorecase("chrome")) { caps = desiredcapabilities.chrome(); } else if(browser.equalsignorecase("ie")){ caps = desiredcapabilities.edge(); caps.setcapability("platform", "windows 10"); caps.setcapability("version", "14.14393"); caps.setcapability("name", methodname); } else{ //if no browser passed throw exception throw new exception("browser not correct"); } string hub = "http://localhost:4443/wd/hub"; driver = new remotewebdriver(new url(hub), caps); return driver; }
these errors i'm getting
org.openqa.selenium.sessionnotcreatedexception: unable create new remote session. desired capabilities = capabilities [{browsername=chrome, version=, platform=any}], required capabilities = capabilities [{}] build info: version: '3.3.1', revision: '5234b325d5', time: '2017-03-10 09:10:29 +0000' system info: host: 'neymar', ip: '169.254.112.118', os.name: 'windows 8.1', os.arch: 'amd64', os.version: '6.3', java.version: '1.8.0_45' driver info: driver.version: remotewebdriver @ org.openqa.selenium.remote.protocolhandshake.createsession(protocolhandshake.java:126) @ org.openqa.selenium.remote.httpcommandexecutor.execute(httpcommandexecutor.java:141) @ org.openqa.selenium.remote.remotewebdriver.execute(remotewebdriver.java:604) @ org.openqa.selenium.remote.remotewebdriver.startsession(remotewebdriver.java:244) @ org.openqa.selenium.remote.remotewebdriver.<init>(remotewebdriver.java:131) @ org.openqa.selenium.remote.remotewebdriver.<init>(remotewebdriver.java:158) @ com.gnow.gnow.utils.commonconfiguration.cbt(commonconfiguration.java:213) @ com.gnow.gnow.test.test.setup(test.java:69) @ sun.reflect.nativemethodaccessorimpl.invoke0(native method) @ sun.reflect.nativemethodaccessorimpl.invoke(unknown source) @ sun.reflect.delegatingmethodaccessorimpl.invoke(unknown source) @ java.lang.reflect.method.invoke(unknown source) @ org.testng.internal.methodinvocationhelper.invokemethod(methodinvocationhelper.java:104) @ org.testng.internal.invoker.invokeconfigurationmethod(invoker.java:515) @ org.testng.internal.invoker.invokeconfigurations(invoker.java:217) @ org.testng.internal.invoker.invokemethod(invoker.java:590) @ org.testng.internal.invoker.invoketestmethod(invoker.java:851) @ org.testng.internal.invoker.invoketestmethods(invoker.java:1177) @ org.testng.internal.testmethodworker.invoketestmethods(testmethodworker.java:129) @ org.testng.internal.testmethodworker.run(testmethodworker.java:112) @ org.testng.testrunner.privaterun(testrunner.java:756) @ org.testng.testrunner.run(testrunner.java:610) @ org.testng.suiterunner.runtest(suiterunner.java:387) @ org.testng.suiterunner.runsequentially(suiterunner.java:382) @ org.testng.suiterunner.privaterun(suiterunner.java:340) @ org.testng.suiterunner.run(suiterunner.java:289) @ org.testng.suiterunnerworker.runsuite(suiterunnerworker.java:52) @ org.testng.suiterunnerworker.run(suiterunnerworker.java:86) @ org.testng.testng.runsuitessequentially(testng.java:1293) @ org.testng.testng.runsuiteslocally(testng.java:1218) @ org.testng.testng.runsuites(testng.java:1133) @ org.testng.testng.run(testng.java:1104) @ org.testng.remote.abstractremotetestng.run(abstractremotetestng.java:132) @ org.testng.remote.remotetestng.initandrun(remotetestng.java:230) @ org.testng.remote.remotetestng.main(remotetestng.java:76)
thanks in advance
[1]: https://github.com/bonigarcia/webdrivermanager
first thing suggest upgrade selenium version selenium 3.5.1
there bug in selenium 3.3.1 wherein actual error wouldn't passed on end-user, , stacktrace seems suggest it's perhaps due bug why aren't able see real problem. bug fixed in 3.4.0
once upgrade selenium 3.5.1 in client side, should see problem.
since mentioned chrome
, guessing perhaps due fact chromedriver not available in path
.
you might want take @ this tutorial wrote on grid, tells set of things required grid , running. have included lot of other information grid in there.
Comments
Post a Comment