Пытаюсь настроить Remote Selenium браузер
100.96.32.145 - HUB
100.96.32.141 - NODE
Запускаю на HUB комманду:
java -jar resources/browser_drivers/selenium-server-4.0.0-alpha-5.jar hub --allow-cors --host 100.96.32.145 --port 9999
Запускаю на NODE комманду:
java -jar resources/browser_drivers/selenium-server-4.0.0-alpha-5.jar node --allow-cors --host 100.96.32.141 --port 8888 --detect-drivers --publish-events tcp://100.96.32.145:4442 --subscribe-events tcp://100.96.32.145:4443
Запускаю консоль python3:
from selenium import webdriver
from selenium.common.exceptions import *
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.chrome.options import Options as CH_Options
from selenium.webdriver.chrome.service import Service
from selenium.webdriver.firefox.options import Options as FF_Options
firefox_path = "/home/labuser/automation/resources/browser_drivers/linux/geckodriver"
option = FF_Options()
option.add_argument("--disable-infobars")
option.add_argument("--disable-extensions")
option.add_argument("--headless")
Если пробую запустить на локальном хосте то все работает:
driver = webdriver.Firefox(executable_path=firefox_path, options=option)
driver.get("https://www.gmail.com")
driver.find_element(By.ID, 'email')
Но когда пытаюсь создать ремоут:
remote_driver = webdriver.Remote(command_executor='http://100.96.32.145:9999', options=option)
Не запускается и возвращает следующую ошибку:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/labuser/.local/lib/python3.6/site-packages/selenium/webdriver/remote/webdriver.py", line 172, in __init__
self.start_session(capabilities, browser_profile)
File "/home/labuser/.local/lib/python3.6/site-packages/selenium/webdriver/remote/webdriver.py", line 269, in start_session
response = self.execute(Command.NEW_SESSION, parameters)
File "/home/labuser/.local/lib/python3.6/site-packages/selenium/webdriver/remote/webdriver.py", line 338, in execute
self.error_handler.check_response(response)
File "/home/labuser/.local/lib/python3.6/site-packages/selenium/webdriver/remote/errorhandler.py", line 240, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.SessionNotCreatedException: Message: Unable to find provider for session: Capabilities {acceptInsecureCerts: true, browserName: firefox, moz:firefoxOptions: {args: [--disable-infobars, --disable-extensions, --headless]}, pageLoadStrategy: normal}
Build info: version: '4.0.0-alpha-5', revision: 'b3a0d621cc'
System info: host: 'worker-43-06', ip: '100.96.32.145', os.name: 'Linux', os.arch: 'amd64', os.version: '3.10.0-957.el7.x86_64', java.version: '1.8.0_181'
Driver info: driver.version: unknown
Stacktrace:
org.openqa.selenium.SessionNotCreatedException: Unable to find provider for session: Capabilities {acceptInsecureCerts: true, browserName: firefox, moz:firefoxOptions: {args: [--disable-infobars, --disable-extensions, --headless]}, pageLoadStrategy: normal}
Build info: version: '4.0.0-alpha-5', revision: 'b3a0d621cc'
System info: host: 'worker-43-06', ip: '100.96.32.145', os.name: 'Linux', os.arch: 'amd64', os.version: '3.10.0-957.el7.x86_64', java.version: '1.8.0_181'
Driver info: driver.version: unknown
at org.openqa.selenium.grid.distributor.local.LocalDistributor.lambda$newSession$4(LocalDistributor.java:161)
at java.util.Optional.orElseThrow(Optional.java:290)
at org.openqa.selenium.grid.distributor.local.LocalDistributor.newSession(LocalDistributor.java:155)
at org.openqa.selenium.grid.distributor.Distributor.lambda$new$0(Distributor.java:89)
at org.openqa.selenium.remote.http.Route$TemplatizedRoute.handle(Route.java:191)
at org.openqa.selenium.remote.http.Route.execute(Route.java:70)
at org.openqa.selenium.remote.http.Route$CombinedRoute.handle(Route.java:335)
at org.openqa.selenium.remote.http.Route.execute(Route.java:70)
at org.openqa.selenium.grid.distributor.Distributor.execute(Distributor.java:123)
at org.openqa.selenium.remote.tracing.SpanWrappedHttpHandler.execute(SpanWrappedHttpHandler.java:62)
at org.openqa.selenium.remote.http.Filter$1.execute(Filter.java:63)
at org.openqa.selenium.remote.http.Route$CombinedRoute.handle(Route.java:335)
at org.openqa.selenium.remote.http.Route.execute(Route.java:70)
at org.openqa.selenium.grid.router.Router.execute(Router.java:68)
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:38)
at org.openqa.selenium.remote.http.Filter$1.execute(Filter.java:63)
at org.openqa.selenium.netty.server.SeleniumHandler.lambda$channelRead0$0(SeleniumHandler.java:48)
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)
То есть если я правилно понимаю ругается что не может найти драйвер, уже всю голову сломал не могу разобраться. Подтолкните пожалуйста в правильном направлении
[labuser@worker-43-06 automation]$ firefox --version
Failed to open connection to "session" message bus: Unable to autolaunch a dbus-daemon without a $DISPLAY for X11
Running without a11y support!
Mozilla Firefox 60.2.2
[labuser@worker-43-06 automation]$ geckodriver --version
geckodriver 0.26.0 (e9783a644016 2019-10-10 13:38 +0000)
The source code of this program is available from
testing/geckodriver in https://hg.mozilla.org/mozilla-central.
This program is subject to the terms of the Mozilla Public License 2.0.
You can obtain a copy of the license at https://mozilla.org/MPL/2.0/.
[labuser@worker-43-06 automation]$