Selenium 4, setup hub and nodes

288 views
Skip to first unread message

Alexandr Plekhau

unread,
Jul 22, 2020, 4:24:33 PM7/22/20
to Selenium Users
I setup hub and nodes using script:

set seleniumjar=selenium-server-4.0.0-alpha-6.jar
set hub_url=http://localhost:4444

start
/MIN java -jar %seleniumjar% hub -p 4444

start
/MIN java -jar %seleniumjar% node --public-url %hub_url%

(folder contains chromedriver.exe, geckodriver.exe, msedgedriver.exe, selenium-server-4.0.0-alpha-6.jar)

code:
        ChromeOptions options = new ChromeOptions();
       
WebDriver driver = new RemoteWebDriver(new URL("http://localhost:4444"), options);
        driver
.get("http://google.com");

It works fine.

If I put chromedriver file (for example, text file without extension with content "chromedriver") it will break selenium grid.
hub and node are started successfully:
hub:
11:17:11.596 INFO [LoggingOptions.getTracer] - Using OpenTelemetry for tracing
11:17:11.597 INFO [LoggingOptions.createTracer] - Using OpenTelemetry for tracing
11:17:11.632 INFO [EventBusOptions.createBus] - Creating event bus: org.openqa.selenium.events.zeromq.ZeroMqEventBus
11:17:11.791 INFO [BoundZmqEventBus.<init>] - XPUB binding to [binding to tcp://*:4442, advertising as tcp://192.168.31.217:4442], XSUB binding to [binding to tcp://*:4443, advertising as tcp://192.168.31.217:4443]
11:17:11.831 INFO [UnboundZmqEventBus.<init>] - Connecting to tcp://192.168.31.217:4442 and tcp://192.168.31.217:4443
11:17:11.831 INFO [UnboundZmqEventBus.<init>] - Sockets created
11:17:11.841 INFO [UnboundZmqEventBus.lambda$new$2] - Bus started
11:17:12.061 INFO [BoundZmqEventBus.<init>] - Event bus ready
11:17:12.551 INFO [LocalDistributor.refresh] - Creating a new remote node for http://192.168.31.217:5555
11:17:12.731 INFO [Hub.execute] - Started Selenium hub 4.0.0-alpha-6 (revision 5f43a29cfc): http://192.168.31.217:4444
11:17:13.036 INFO [LocalDistributor.add] - Added node f694a832-d32e-4410-be39-e5631ea69ed6.
11:17:13.059 INFO [Host.lambda$new$0] - Changing status of node f694a832-d32e-4410-be39-e5631ea69ed6 from DOWN to UP. Reason: http://192.168.31.217:5555 is ok
node:
11:17:11.596 INFO [LoggingOptions.getTracer] - Using OpenTelemetry for tracing
11:17:11.597 INFO [LoggingOptions.createTracer] - Using OpenTelemetry for tracing
11:17:11.629 INFO [EventBusOptions.createBus] - Creating event bus: org.openqa.selenium.events.zeromq.ZeroMqEventBus
11:17:11.741 INFO [UnboundZmqEventBus.<init>] - Connecting to tcp://*:4442 and tcp://*:4443
11:17:11.771 INFO [UnboundZmqEventBus.<init>] - Sockets created
11:17:11.776 INFO [UnboundZmqEventBus.lambda$new$2] - Bus started
11:17:12.081 INFO [NodeServer.execute] - Reporting self as: http://192.168.31.217:5555
11:17:12.191 INFO [NodeOptions.report] - Adding Chrome for {"browserName": "chrome"} 4 times
11:17:12.191 INFO [NodeOptions.report] - Adding Edge for {"browserName": "MicrosoftEdge"} 4 times
11:17:12.191 INFO [NodeOptions.report] - Adding Firefox for {"browserName": "firefox"} 4 times
11:17:12.501 INFO [NodeServer.execute] - Started Selenium node 4.0.0-alpha-6 (revision 5f43a29cfc): http://192.168.31.217:5555
11:17:12.504 INFO [NodeServer.execute] - Starting registration process for node id f694a832-d32e-4410-be39-e5631ea69ed6
11:17:13.061 INFO [NodeServer.lambda$execute$0] - Node has been added

if I try to run my code I will get error:
11:20:36.886 WARN [SpanWrappedHttpHandler.execute] - Unable to execute request: Unable to create session for <CreateSessionRequest with Capabilities {browserName: chrome, goog:chromeOptions: {args: [], extensions: []}}>
Build info: version: '4.0.0-alpha-6', revision: '5f43a29cfc'
System info: host: 'ALEXANDRDESKTOP', ip: '192.168.31.217', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_251'
Driver info: driver.version: unknown
org
.openqa.selenium.SessionNotCreatedException: Unable to create session for <CreateSessionRequest with Capabilities {browserName: chrome, goog:chromeOptions: {args: [], extensions: []}}>
Build info: version: '4.0.0-alpha-6', revision: '5f43a29cfc'
System info: host: 'ALEXANDRDESKTOP', ip: '192.168.31.217', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_251'
Driver info: driver.version: unknown
        at org
.openqa.selenium.grid.distributor.local.Slot.lambda$onReserve$1(Slot.java:82)
        at java
.util.Optional.orElseThrow(Optional.java:290)
        at org
.openqa.selenium.grid.distributor.local.Slot.lambda$onReserve$2(Slot.java:81)
        at org
.openqa.selenium.grid.distributor.local.LocalDistributor.newSession(LocalDistributor.java:169)
        at org
.openqa.selenium.grid.distributor.Distributor.lambda$new$0(Distributor.java:88)
        at org
.openqa.selenium.remote.http.Route$TemplatizedRoute.handle(Route.java:183)
        at org
.openqa.selenium.remote.http.Route.execute(Route.java:67)
        at org
.openqa.selenium.remote.http.Route$CombinedRoute.handle(Route.java:327)
        at org
.openqa.selenium.remote.http.Route.execute(Route.java:67)
        at org
.openqa.selenium.grid.distributor.Distributor.execute(Distributor.java:123)
        at org
.openqa.selenium.remote.tracing.SpanWrappedHttpHandler.execute(SpanWrappedHttpHandler.java:75)
        at org
.openqa.selenium.remote.http.Filter$1.execute(Filter.java:64)
        at org
.openqa.selenium.remote.http.Route$CombinedRoute.handle(Route.java:327)
        at org
.openqa.selenium.remote.http.Route.execute(Route.java:67)
        at org
.openqa.selenium.grid.router.Router.execute(Router.java:67)
        at org
.openqa.selenium.remote.http.Route$CombinedRoute.handle(Route.java:327)
        at org
.openqa.selenium.remote.http.Route.execute(Route.java:67)
        at org
.openqa.selenium.grid.server.AddWebDriverSpecHeaders.lambda$apply$0(AddWebDriverSpecHeaders.java:30)
        at org
.openqa.selenium.grid.server.WrapExceptions.lambda$apply$0(WrapExceptions.java:36)
        at org
.openqa.selenium.remote.http.Filter$1.execute(Filter.java:64)
        at org
.openqa.selenium.netty.server.SeleniumHandler.lambda$channelRead0$0(SeleniumHandler.java:46)
        at java
.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
        at java
.util.concurrent.FutureTask.run(FutureTask.java:266)
        at java
.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
        at java
.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
        at java
.lang.Thread.run(Thread.java:748)

What is wrong in my case? It looks like a bug.
Is it possible to set exact path to webdriver in selenium 4?

Reply all
Reply to author
Forward
0 new messages