question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

WebDriverException: let's add some info about the Grid node

See original GitHub issue

🚀 Feature Proposal

WebDriverException’s should include the IP of the Grid node which is actually executing the commands, along with the info about the host running the test (which is being printed already).

Motivation

I’ve just bumped into an exception (pasted below) which is due to an issue between the Grid and the SUT, and I’ve realised that there is no way for me to figure out, just by looking at the exception, which node(s) of the Grid are affected (only one or two, or all?): the exception mentions the host executing the tests (which I don’t really care about), but it doesn’t say anything about the specific grid node running the browser (which I do care about).

org.openqa.selenium.WebDriverException: Unable to parse remote response: <html>
[..]
</html>

	at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:115)
	at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:74)
	at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:136)
	at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:552)
	at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:213)
	at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:131)
	at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:144)
	at RemoteDriverFactory.createDriver(RemoteDriverFactory.java:21)
       [..]
Caused by: org.openqa.selenium.json.JsonException: Unable to determine type from: <. Last 1 characters read: <
Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:17:03'
System info: host: 'xxxxx', ip: 'xxx', os.name: 'Linux', os.arch: 'amd64', os.version: 'xxx', java.version: 'xxx'
Driver info: driver.version: LazyWebDriver
	at org.openqa.selenium.json.JsonInput.peek(JsonInput.java:122)
	at org.openqa.selenium.json.JsonTypeCoercer.lambda$null$6(JsonTypeCoercer.java:140)
	at org.openqa.selenium.json.JsonTypeCoercer.coerce(JsonTypeCoercer.java:126)
	at org.openqa.selenium.json.Json.toType(Json.java:69)
	at org.openqa.selenium.json.Json.toType(Json.java:55)
	at org.openqa.selenium.json.Json.toType(Json.java:50)
	at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:112)
	at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:74)
	at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:136)
	at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:552)
	at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:213)
	at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:131)
	at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:144)
       [..]

PS: it seems to me that this is unrelated to this particular exception I got. I mean, no WebDriverException ever prints any info about the Grid node.

Example

I would expect any WebDriverException raised by a RemoteWebDriver (i.e. Grid mode), to look ideally like this (see in particular the last line, starting with “Grid info”):

org.openqa.selenium.json.WebDriverException: Some message
Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:17:03'
System info: host: 'xxxxx', ip: 'xxx', os.name: 'Linux', os.arch: 'amd64', os.version: 'xxx', java.version: 'xxx'
Driver info: driver.version: RemoteWebDriver
Grid info: hub: x.x.x.x, node: 'y.y.y.y'

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:12 (11 by maintainers)

github_iconTop GitHub Comments

4reactions
diemolcommented, Dec 14, 2021

@dratler sorry for the late response. Yes, of course! However, I had a quick look and I am not sure where is the best place to add it. We need to follow the request flow and find that spot.

@asolntsev this issue showed me that we are not using the host and IP information from the Node to render it in the WebDriverException on the client side. We should remove that logic from that method, now I agree with you 😃

1reaction
diemolcommented, Jan 31, 2022

@asolntsev, yes please!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Failed to connect Couldn't register this node: Error sending the ...
First of all, to start the Selenium Grid Hub on port 2222 you need to issue ... In Node Machine , Download standalone...
Read more >
Get remote host/node name from Selenium Grid Hub on error
Occasionally when running tests in a Selenium Grid, some tests get the following error: org.openqa.selenium.WebDriverException: Unable to connect to host ...
Read more >
Selenium Grid Tutorial: Playing with node registration ...
So lets see all the parameters and their use one after another.. -port : In general understand it as an address for specific...
Read more >
Complete setup of Selenium Grid 2.0 with Hub and Node setup
Selenium grid will take care of drivers. Only thing which you need to take care of is, corresponding browsers should be installed on...
Read more >
Customizing a Node - Selenium
Custom Node as a regular jar · Create a sample project using your favourite build tool (Maven|Gradle). · Add the below dependency to...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found