Tried to setup a Selenium node on Mac using:
java -jar selenium-server-standalone-2.44.0.jar -role node \
-hub http://<<Hub Ip>> :4444/grid/regsiter -port 5557 \
-browser browserName=firefox,platform=MAC \
-remoteHost http://<<Remote Ip>>:5557
Error:
11:34:11.014 INFO - Adding browserName=firefox,platform=MAC
11:34:11.016 INFO - Adding browserName=chrome,platform=MAC
11:35:27.004 WARN - error getting the parameters from the hub. The
node may end up with wrong timeouts.Connect to Hub IP:80 [/Hub
IP] failed: Operation timed out 11:35:27.028 INFO - Java: Oracle
Corporation 23.25-b01 11:35:27.028 INFO - OS: Mac OS X 10.10.2 x86_64
11:35:27.038 INFO - v2.44.0, with Core v2.44.0. Built from revision
76d78cf 11:35:27.198 INFO - Default driver
org.openqa.selenium.ie.InternetExplorerDriver registration is skipped:
registration capabilities Capabilities [{platform=WINDOWS,
ensureCleanSession=true, browserName=internet explorer, version=}]
does not match with current platform: MAC 11:35:27.254 INFO -
RemoteWebDriver instances should connect to:
http://127.0.0.1:5556/wd/hub 11:35:27.256 INFO - Version Jetty/5.1.x
11:35:27.259 INFO - Started
HttpContext[/selenium-server/driver,/selenium-server/driver]
11:35:27.260 INFO - Started
HttpContext[/selenium-server,/selenium-server] 11:35:27.261 INFO -
Started HttpContext[/,/] 11:35:27.294 INFO - Started
org.openqa.jetty.jetty.servlet.ServletHandler#5f6b70e1 11:35:27.295
INFO - Started HttpContext[/wd,/wd] 11:35:27.299 INFO - Started
SocketListener on 0.0.0.0:5556 11:35:27.299 INFO - Started
org.openqa.jetty.jetty.Server#2c11c55b 11:35:27.346 INFO - using the
json request :
{"class":"org.openqa.grid.common.RegistrationRequest","configuration":{"register":true,"port":5556,"host":"<>","proxy":"org.openqa.grid.selenium.proxy.DefaultRemoteProxy","browser":"browserName\u003dfirefox,platform\u003dMAC","maxSession":5,"role":"node","hubHost":"Hub
IP","registerCycle":5000,"hub":"http://<Remote
IP:5556","remoteHost":"http://Remote Ip:5556"},"capabilities":[{"seleniumProtocol":"WebDriver","platform":"MAC","browserName":"firefox"},{"seleniumProtocol":"WebDriver","platform":"MAC","browserName":"chrome"}]}
11:35:27.347 INFO - Starting auto register thread. Will try to
register every 5000 ms. 11:35:27.347 INFO - Registering the node to
hub :http://**Remote IP:-1/grid/register 11:36:43.151 INFO -
couldn't register this node : Error sending the registration request
Your command appears to have a typo.
-hub http://<<Hub Ip>> :4444/grid/regsiter
^ ^^
here and here
Change this to:
-hub http://<<hubip>>:4444/grid/register
^ ^^
no space fix transposition
Additionally, I've always used the directive -hubUrl, not -hub. They may be synonyms, but if this solution I provided above still does not work, try also replacing -hub with -hubUrl.
Related
We are getting an the below error try.SeleniumSpanExporter","log-time-local": "2022-09-22T13:07:01.425Z","log-time-utc": "2022-09-22T13:07:01.425Z","method": "lambda$export$4"} 13:07:01.425 DEBUG [LocalDistributor.add] - Exception while adding Node http://10.251.155.85:5555 java.io.UncheckedIOException: java.net.ConnectException: connection timed out: /10.251.155.**:5555
Hub Command: java -jar selenium-server-4.0.0.jar hub
O/P-HUB Output
Node Command: java -jar selenium-server-4.4.0.jar node --hub http://10...**:4444/grid/register [Passing the hub IP]
O/P-
C:\Users\Administrator>java -jar C:\apps\relay\webcluster\selenium-server.jar node --publish-events tcp://10.251.155.74:4442 --subscribe-events tcp://10.251.155.74:4443
07:35:34.313 INFO [LogManager$RootLogger.log] - Using the system default encoding
07:35:34.317 INFO [OpenTelemetryTracer.createTracer] - Using OpenTelemetry for tracing
07:35:34.481 INFO [UnboundZmqEventBus.<init>] - Connecting to tcp://10.251.155.74:4442 and tcp://10.251.155.74:4443
07:35:34.565 INFO [UnboundZmqEventBus.<init>] - Sockets created
07:35:35.567 INFO [UnboundZmqEventBus.<init>] - Event bus ready
07:35:35.683 INFO [NodeServer.createHandlers] - Reporting self as: http://10.251.155.85:5555
07:35:35.752 INFO [NodeOptions.getSessionFactories] - Detected 4 available processors
07:35:35.783 INFO [NodeOptions.discoverDrivers] - Discovered 2 driver(s)
07:35:35.821 INFO [NodeOptions.report] - Adding Chrome for {"browserName": "chrome"} 4 times
07:35:35.821 INFO [NodeOptions.report] - Adding Firefox for {"browserName": "firefox"} 4 times
07:35:35.868 INFO [Node.<init>] - Binding additional locator mechanisms: relative, name, id
07:35:36.138 INFO [NodeServer$1.start] - Starting registration process for Node http://10.251.155.85:5555
07:35:36.138 INFO [NodeServer.execute] - Started Selenium node 4.4.0 (revision e5c75ed026a): http://10.251.155.85:5555
07:35:36.169 INFO [NodeServer$1.lambda$start$1] - Sending registration event...
07:35:46.186 INFO [NodeServer$1.lambda$start$1] - Sending registration event...
07:35:56.202 INFO [NodeServer$1.lambda$start$1] - Sending registration event...
I also tried with passing java -jar selenium-server-.jar node --publish-events tcp://:8886 --subscribe-events tcp://:8887 still no luck .
Selenium hub is up and running on Windows desktop, set up Windows VM to be node. Node won't register to hub.
Step 1:
Entered command in Windows Desktop:
java -jar selenium-server-standalone-3.14.0.jar -role hub -port 2222
Output:
`11:11:24.171 INFO [GridLauncherV3.launch] - Selenium build info: version: '3.14.0', revision: 'aacccce0'
11:11:24.175 INFO [GridLauncherV3$2.launch] - Launching Selenium Grid hub on port 2222
11:11:25.108:INFO::main: Logging initialized #2242ms to org.seleniumhq.jetty9.util.log.StdErrLog
11:11:26.832 INFO [Hub.start] - Selenium Grid hub is up and running
11:11:26.832 INFO [Hub.start] - Nodes should register to http://172.20.111.25:2222/grid/register/
11:11:26.832 INFO [Hub.start] - Clients should connect to http://172.20.111.25:2222/wd/hub`
Checked the config page on localhost and saw that it was there.
Step 2:
Entered this into the command line in Windows Virtual Machine:
java -jar selenium-server-standalone-3.14.0.jar -role node -hub http://172.20.111.25:2222/grid/register
Output:
10:18:43.108 INFO [GridLauncherV3.launch] - Selenium build info: version: '3.14.0', revision: 'aacccce0'
10:18:43.155 INFO [GridLauncherV3$3.launch] - Launching a Selenium Grid node on port 18004
2019-06-03 10:18:43.676:INFO::main: Logging initialized #1482ms to org.seleniumhq.jetty9.util.log.StdErrLog
10:18:44.108 INFO [SeleniumServer.boot] - Selenium Server is up and running on port 18004
10:18:44.108 INFO [GridLauncherV3$3.launch] - Selenium Grid node is up and ready to register to the hub
10:18:44.280 INFO [SelfRegisteringRemote$1.run] - Starting auto registration thread. Will try to register every 5000 ms.
10:18:44.280 INFO [SelfRegisteringRemote.registerToHub] - Registering the node to the hub: http://172.20.111.25:2222/grid/register
10:19:06.003 INFO [SelfRegisteringRemote$1.run] - Couldn't register this node: Error sending the registration request: Failed to connect to /172.20.111.25:2222
You were almost there. You need to remove the additional forward slash (i.e. /) at the end of the registration uri while registering the Selenium Grid Node and you can use the following steps:
First of all, to start the Selenium Grid Hub on port 2222 you need to issue the following command:
java -jar selenium-server-standalone-3.14.0.jar -role hub -port 2222
You will find the following logs generated:
16:00:50.746 INFO [GridLauncherV3.launch] - Selenium build info: version: '3.14.0', revision: 'aacccce0'
16:00:50.750 INFO [GridLauncherV3$2.launch] - Launching Selenium Grid hub on port 2222
2019-05-31 16:00:51.392:INFO::main: Logging initialized #1151ms to org.seleniumhq.jetty9.util.log.StdErrLog
16:00:52.139 INFO [Hub.start] - Selenium Grid hub is up and running
16:00:52.141 INFO [Hub.start] - Nodes should register to http://192.168.1.125:2222/grid/register/
16:00:52.141 INFO [Hub.start] - Clients should connect to http://192.168.1.125:2222/wd/hub
Now you can access the Selenium Grid Console through the URL:
http://localhost:2222/grid/console
The console will look like:
Now finally to start the Selenium Grid Node you have to issue the following command:
java -jar selenium-server-standalone-3.14.0.jar -role node -hub http://192.168.1.125:2222/grid/register
You will find the following logs generated:
16:04:48.440 INFO [GridLauncherV3.launch] - Selenium build info: version: '3.14.0', revision: 'aacccce0'
16:04:48.470 INFO [GridLauncherV3$3.launch] - Launching a Selenium Grid node onport 7724
2019-05-31 16:04:48.985:INFO::main: Logging initialized #1059ms to org.seleniumhq.jetty9.util.log.StdErrLog
16:04:49.275 INFO [SeleniumServer.boot] - Selenium Server is up and running on port 7724
16:04:49.275 INFO [GridLauncherV3$3.launch] - Selenium Grid node is up and ready to register to the hub
16:04:49.454 INFO [SelfRegisteringRemote$1.run] - Starting auto registration thread. Will try to register every 5000 ms.
16:04:49.454 INFO [SelfRegisteringRemote.registerToHub] - Registering the node to the hub: http://192.168.1.125:2222/grid/register
16:04:50.355 INFO [SelfRegisteringRemote.registerToHub] - The node is registered to the hub and ready to use
I would suggest to go through the steps mentioned below through which I am successfully able to resolve that issue.
Login to other machine and register it as a node.
Ping IP from both the machines to check whether you're on a same network.
Verify that Windows Defender Firewall should be off to ping machine when you're trying on a same network.
In Node Machine , Download standalone jar and paste in some directory and open cmd from that directory .
Verify whether you're able to check URL in Node machine
Ex: URL : http://xx.xx.xx.xx:4444/grid/console
Run the command :
java -Dwebdriver.chrome.driver="C:\chromedriver.exe" -jar selenium-server-standalone-3.141.59.jar -role webdriver -hub http://xx.xx.xx.xx:4444/grid/register -port 5566
Okay, I believe I fixed this error.
So I started the hub from my desktop: 172.17.248.33
and then I tried to connect the node from my virtual machine: 173.248.137.73 back to my desktop 172.17.248.33.
I knew beforehand that when I started the hub from my desktop and then ran a node on my desktop it would connect.
However, I was under the impression I could start the hub in my desktop 172.17.248.33 and then have my VM node 173.248.137.73 connected to the hub desktop. I am guessing this is not possible with Selenium.
Once I started the hub from my virtual machine and initiated the node command from the same machine, it worked.
For the past few days, I was running tests using Selenium WebDriver with no issues. However, even though I didn't change anything in the code or my system, the last few times I tried to create a new browser session, I always get the following error:
Link
This happens regardless of whether I try to create a session through code, or manually through the browser.
This is the result of running the Selenium server and three tests:
$ java -jar selenium-server-standalone-3.9.1.jar
05:54:58.659 INFO - Selenium build info: version: '3.9.1', revision: '63f7b50'
05:54:58.660 INFO - Launching a standalone Selenium Server on port 4444
2019-04-18 05:54:58.754:INFO::main: Logging initialized #269ms to org.seleniumhq.jetty9.util.log.StdErrLog
2019-04-18 05:54:58.821:INFO:osjs.Server:main: jetty-9.4.7.v20170914, build timestamp: 2017-11-21T22:27:37+01:00, git hash: 82b8fb23f757335bb3329d540ce37a2a2615f0a8
2019-04-18 05:54:58.840:WARN:osjs.SecurityHandler:main: ServletContext#o.s.j.s.ServletContextHandler#65d6b83b{/,null,STARTING} has uncovered http methods for path: /
2019-04-18 05:54:58.843:INFO:osjsh.ContextHandler:main: Started o.s.j.s.ServletContextHandler#65d6b83b{/,null,AVAILABLE}
2019-04-18 05:54:58.859:INFO:osjs.AbstractConnector:main: Started ServerConnector#1de74ecb{HTTP/1.1,[http/1.1]}{0.0.0.0:4444}
2019-04-18 05:54:58.859:INFO:osjs.Server:main: Started #374ms
05:54:58.859 INFO - Selenium Server is up and running on port 4444
2019-04-18 05:55:04.002:INFO:osjshC.ROOT:qtp527446182-17: org.openqa.selenium.remote.server.WebDriverServlet-57175e74: Initialising WebDriverServlet
05:55:04.110 INFO - Found handler: org.openqa.selenium.remote.server.commandhandler.Status#4d5a702a
05:55:04.114 INFO - /status: Executing GET on /status (handler: Status)
05:55:04.178 INFO - Found handler: org.openqa.selenium.remote.server.commandhandler.GetAllSessions#3026be33
05:55:04.178 INFO - /sessions: Executing GET on /sessions (handler: GetAllSessions)
05:55:09.248 INFO - Found handler: org.openqa.selenium.remote.server.commandhandler.BeginSession#48e79260
05:55:09.249 INFO - /session: Executing POST on /session (handler: BeginSession)
05:55:09.333 INFO - Capabilities are: Capabilities {browserName: chrome}
05:55:09.334 INFO - Capabilities {browserName: chrome} matched class org.openqa.selenium.remote.server.ServicedSession$Factory (provider: org.openqa.selenium.chrome.ChromeDriverService)
Starting ChromeDriver 2.41.578700 (2f1ed5f9343c13f73144538f15c00b370eda6706) on port 27011
Only local connections are allowed.
05:55:09.788 INFO - Detected dialect: OSS
06:01:50.907 INFO - Found handler: org.openqa.selenium.remote.server.commandhandler.BeginSession#79d0ad1d
06:01:50.907 INFO - Found handler: org.openqa.selenium.remote.server.commandhandler.BeginSession#1ff85274
06:01:50.907 INFO - Found handler: org.openqa.selenium.remote.server.commandhandler.BeginSession#2d87d7a2
06:01:50.908 INFO - /session: Executing POST on /session (handler: BeginSession)
06:01:50.908 INFO - /session: Executing POST on /session (handler: BeginSession)
06:01:50.908 INFO - /session: Executing POST on /session (handler: BeginSession)
06:01:50.912 INFO - Capabilities are: Capabilities {browserName: chrome}
06:01:50.912 INFO - Capabilities are: Capabilities {browserName: chrome}
06:01:50.912 INFO - Capabilities are: Capabilities {browserName: chrome}
06:01:50.912 INFO - Capabilities {browserName: chrome} matched class org.openqa.selenium.remote.server.ServicedSession$Factory (provider: org.openqa.selenium.chrome.ChromeDriverService)
06:01:50.912 INFO - Capabilities {browserName: chrome} matched class org.openqa.selenium.remote.server.ServicedSession$Factory (provider: org.openqa.selenium.chrome.ChromeDriverService)
06:01:50.912 INFO - Capabilities {browserName: chrome} matched class org.openqa.selenium.remote.server.ServicedSession$Factory (provider: org.openqa.selenium.chrome.ChromeDriverService)
Starting ChromeDriver 2.41.578700 (2f1ed5f9343c13f73144538f15c00b370eda6706) on port 29789
Only local connections are allowed.
Starting ChromeDriver 2.41.578700 (2f1ed5f9343c13f73144538f15c00b370eda6706) on port 32366
Only local connections are allowed.
Starting ChromeDriver 2.41.578700 (2f1ed5f9343c13f73144538f15c00b370eda6706) on port 15121
Only local connections are allowed.
06:01:51.271 INFO - Detected dialect: OSS
06:01:51.335 INFO - Detected dialect: OSS
06:01:51.449 INFO - Detected dialect: OSS
I've tried downgrading, reinstalling everything, but nothing seems to work.
What I'm using:
Ubuntu 18.04
Selenium Java Server 3.9.1
Chrome 73
Chrome Driver 74
Also, oddly enough, my colleague who similarly is working on Selenium with me, is now running into the exact same issue on their own system.
This error message...
Starting ChromeDriver 2.41.578700 (2f1ed5f9343c13f73144538f15c00b370eda6706) on port 15121
Only local connections are allowed.
06:01:51.271 INFO - Detected dialect: OSS
...implies that your ChromeDriver version is chromedriver=2.41
Your main issue is the incompatibility between the version of the binaries you are using as follows:
You are using chromedriver=2.41
Release Notes of chromedriver=2.41 clearly mentions the following :
Supports Chrome v67-69
Presumably you are using the latest GAed chrome=73.0
Release Notes of ChromeDriver v2.46 clearly mentions the following :
Supports Chrome v71-73
So there is a clear mismatch between ChromeDriver v2.41 and the Chrome Browser v73.0
Solution
Upgrade ChromeDriver to current ChromeDriver v2.46 level.
Keep Chrome version between Chrome v71-73 levels. (as per ChromeDriver v2.46 release notes)
Clean your Project Workspace through your IDE and Rebuild your project with required dependencies only.
Execute your #Test.
I am trying to run the selenium server standalone in a vagrant box, with the following command:
java -jar selenium-server-standalone-3.13.0.jar
When I click the 'create session' button at http://lab.local:4444/wd/hub/static/resource/hub.html from my host web browser. I get a unable to create a new session error message.
I ask to create a firefox browser session for which I get the driver located in /usr/local/bin/geckodriver.
Firefox has been installed on the vagrant box with sudo apt install firefox-esr.
Error log detail:
14:52:04.485 INFO [GridLauncherV3.launch] - Selenium build info: version: '3.13.0', revision: '2f0d292'
14:52:04.486 INFO [GridLauncherV3$1.launch] - Launching a standalone Selenium Server on port 4444
2018-08-09 14:52:04.564:INFO::main: Logging initialized #312ms to org.seleniumhq.jetty9.util.log.StdErrLog
14:52:04.757 INFO [SeleniumServer.boot] - Selenium Server is up and running on port 4444
14:52:15.563 INFO [ActiveSessionFactory.apply] - Capabilities are: {
"browserName": "firefox"
}
14:52:15.568 INFO [ActiveSessionFactory.lambda$apply$11] - Matched factory org.openqa.selenium.remote.server.ServicedSession$Factory (provider: org.openqa.selenium.firefox.GeckoDriverService)
1533819135611 geckodriver INFO geckodriver 0.21.0
1533819135614 geckodriver INFO Listening on 127.0.0.1:25541
1533819135880 mozrunner::runner INFO Running command: "/usr/bin/firefox" "-marionette" "-foreground" "-no-remote" "-profile" "/tmp/rust_mozprofile.yuusnpGo8Gw6"
1533819136508 Marionette INFO Listening on port 2828
When I run the same executable directly from my host, I get no error and the firefox session is created with success.
I try to run a X server, Xvfb as follow but this does not change anything:
Xvfb :1 -screen 0 1600x1200x16 &
export DISPLAY=:1
java -jar selenium-server-standalone-3.13.0.jar
Problem solved after switching to selenium-server-standalone-3.3.1.jar with geckodriver 0.14.0. Sessions are created with success with this configuration.
source.
I prefer to use old Selenium 2.53.1 with old version of Chromium 52.0 and chromedriver 2.24. I'm running following on Windows 7:
start java -jar selenium-server-standalone-2.53.1.jar -Dwebdriver.chrome.driver=C:\dev\selenium\chromedriver.exe -Dwebdriver.chrome.binary=C:\dev\selenium\chrome-win32\chrome.exe -Dwebdriver.chrome.chrome_binary=C:\dev\selenium\chrome-win32\chrome.exe -Dwebdriver.chrome.capabilities.binary=C:\dev\selenium\chrome-win32\chrome.exe -Dwebdriver.chrome.capabilities.chrome_binary=C:\dev\selenium\chrome-win32\chrome.exe -browser browserName="chrome",version=ANY,platform=WINDOWS,maxInstances=1,binary="C:\dev\selenium\chrome-win32\chrome.exe",chrome_binary="C:\dev\selenium\chrome-win32\chrome.exe" -host 0.0.0.0 -port 4444
As you can see I have tried a lot of variants trying both binary and chrome_binary. But Selenium Server ignores those options and starts a default Chrome Browser. How to make it run the binary I specified C:\dev\selenium\chrome-win32\chrome.exe?
09:22:53.149 INFO - Launching a standalone Selenium Server
Setting system property webdriver.chrome.driver to C:\dev\selenium\chromedriver.exe
Setting system property webdriver.chrome.binary to C:\dev\selenium\chrome-win32\chrome.exe
Setting system property webdriver.chrome.chrome_binary to C:\dev\selenium\chrome-win32\chrome.exe
Setting system property webdriver.chrome.capabilities.binary to C:\dev\selenium\chrome-win32\chrome.exe
Setting system property webdriver.chrome.capabilities.chrome_binary to C:\dev\selenium\chrome-win32\chrome.exe
09:22:53.480 INFO - Java: Oracle Corporation 25.65-b01
09:22:53.480 INFO - OS: Windows 7 6.1 amd64
09:22:53.490 INFO - v2.53.1, with Core v2.53.1. Built from revision a36b8b1
09:22:53.569 INFO - Driver class not found: com.opera.core.systems.OperaDriver
09:22:53.569 INFO - Driver provider com.opera.core.systems.OperaDriver is not registered
09:22:53.579 INFO - Driver provider org.openqa.selenium.safari.SafariDriver registration is skipped:
registration capabilities Capabilities [{browserName=safari, version=, platform=MAC}] does not match the current platform VISTA
09:22:53.579 INFO - Driver class not found: org.openqa.selenium.htmlunit.HtmlUnitDriver
09:22:53.579 INFO - Driver provider org.openqa.selenium.htmlunit.HtmlUnitDriver is not registered
09:22:53.928 INFO - RemoteWebDriver instances should connect to: http://127.0.0.1:4444/wd/hub
09:22:53.928 INFO - Selenium Server is up and running
09:22:54.331 INFO - Executing: [new session: Capabilities [{acceptSslCerts=false, browserName=chrome, platform=ANY}]])
09:22:54.345 INFO - Creating a new session for Capabilities [{acceptSslCerts=false, browserName=chrome, platform=ANY}]
Starting ChromeDriver 2.24.417431 (9aea000394714d2fbb20850021f6204f2256b9cf) onport 4923
Only local connections are allowed.
09:22:55.137 INFO - Done: [new session: Capabilities [{acceptSslCerts=false, browserName=chrome, platform=ANY}]]
Related (unaswered):
How to specify the Chrome binary location via the selenium server standalone command line?
Change your command to something like below
start java -Dwebdriver.chrome.driver=C:\dev\selenium\chromedriver.exe
-Dwebdriver.chrome.binary=C:\dev\selenium\chrome-win32\chrome.exe
-Dwebdriver.chrome.chrome_binary=C:\dev\selenium\chrome-win32\chrome.exe
-Dwebdriver.chrome.capabilities.binary=C:\dev\selenium\chrome-win32\chrome.exe
-Dwebdriver.chrome.capabilities.chrome_binary=C:\dev\selenium\chrome-win32\chrome.exe
-jar selenium-server-standalone-2.53.1.jar -browser browserName="chrome",version=ANY,platform=WINDOWS,maxInstances=1,binary="C:\dev\selenium\chrome-win32\chrome.exe",chrome_binary="C:\dev\selenium\chrome-win32\chrome.exe" -host 0.0.0.0 -port 4444
and try again ? You should put the -D JVM argument before the -jar.
For more information refer here.
Seems using Selenium Grid everything works:
start java -Dwebdriver.server.session.timeout=900 -jar selenium-server-standalone-2.53.1.jar -role hub -host 0.0.0.0 -port 4444
start java -Dwebdriver.chrome.driver=C:\dev\selenium\chromedriver.exe -jar selenium-server-standalone-2.53.1.jar -role node -browser browserName="chrome",version=ANY,platform=WINDOWS,maxInstances=1,chrome_binary="C:\dev\selenium\chrome-win32\chrome.exe" -hub http://127.0.0.1:4444/grid/register -port 5555