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:
- Created 2 years ago
- Comments:12 (11 by maintainers)
Top GitHub Comments
@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 😃@asolntsev, yes please!