-
-
Notifications
You must be signed in to change notification settings - Fork 8.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[🐛 Bug]: Connection.java fails to call event callback for DOM.documentUpdated() event #13109
Comments
@jstermask, thank you for creating this issue. We will troubleshoot it as soon as we can. Info for maintainersTriage this issue by using labels.
If information is missing, add a helpful comment and then
If the issue is a question, add the
If the issue is valid but there is no time to troubleshoot it, consider adding the
If the issue requires changes or fixes from an external project (e.g., ChromeDriver, GeckoDriver, MSEdgeDriver, W3C),
add the applicable
After troubleshooting the issue, please add the Thank you! |
Hi, @jstermask. Either a complete code snippet and URL/HTML (if more than one file is needed, provide a GitHub repo and instructions to run the code), the specific versions used, or a more detailed description to help us understand the issue. Note: If you cannot share your code and URL/HTML, any complete code snippet and URL/HTML that reproduces the issue is good enough. Reply to this issue when all information is provided, thank you. |
@jstermask could you check if this issue has been fixed in the latest snapshot? |
Hello,
L255, the JSON payload is parsed using nextName() method. This method expects the JSON to be only made of simple strings. But the reality is not that.
In the above payload, that is handled by selenium Connection.java, we can see that "params" value is not a string but a JSON object. Therefore the inputName() method crashes in this case. |
@jstermask did you run it or did you only read the code? I am pretty sure this has been fixed in a5591ef the mapping method does read the empty object now and the next thing to read is a name again, so the |
Hi ,
I encountered the bug initially by running the code (4.15.0). Then once you
asked me to check again, I only read the code in trunk branch, so it's
likely is misread it.
Indeed, commit a5591ef looks good.
Thanks
Le jeu. 9 nov. 2023, 18:00, joerg1985 ***@***.***> a écrit :
… @jstermask <https://github.com/jstermask> did you run it or did you only
read the code? I am pretty sure this has been fixed in a5591ef
<a5591ef>
the mapping method does read the empty object now and the next thing to
read is a name again, so the nextName call will not fail.
—
Reply to this email directly, view it on GitHub
<#13109 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AE6EOIDAQVME26ATAGHMUVDYDUDZHAVCNFSM6AAAAAA7BKYVIOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQMBUGIYDQNZXGQ>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
@jstermask sorry for the confusion and thank you for the bug report. I will close this now, the issue should be fixed. |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
What happened?
When using selenium chrome devtools and adding a listener DOM.documentUpdated(), the event is triggered, but an JSON exception is thrown when parsing the 'data' to handle to json. This exception prevents the listener to be actually fired.
e.g. in kotlin
Then when executing, doSomething() is never called because there is an exception in Connection.java line 255 selenium class.
While reading the Connection.java code, line 255, we see that data string to parse is :
But code did not expect that "params" attribute value would be another nested JSON object ( {} ). Therefore, when calling input.nextName(), this method fails because it can't parse {} as a string NAME.
To fix this, algorithm should at least try {} catch {} around input.nextName() because sometimes input does contain nested objects, not only strings.
How can we reproduce the issue?
On DevTools, add a Listener on DOM.documentUpdated().
Relevant log output
Operating System
Ubuntu
Selenium version
4.15.0
What are the browser(s) and version(s) where you see this issue?
Chrome 119.0.6045.105
What are the browser driver(s) and version(s) where you see this issue?
Chrome 116, 119.0.6045.105
Are you using Selenium Grid?
No
The text was updated successfully, but these errors were encountered: