Skip to content
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]: JsonException: Unable to find type coercer for class org.openqa.selenium.Cookie #13311

Closed
baflQA opened this issue Dec 14, 2023 · 2 comments · Fixed by #13325
Closed
Assignees
Labels
C-devtools BiDi or Chrome DevTools related issues C-java I-defect needs-triaging

Comments

@baflQA
Copy link
Contributor

baflQA commented Dec 14, 2023

What happened?

A JSON parse error is thrown when capturing the network with BiDi.

How can we reproduce the issue?

I've created a standalone test that can be used to reproduce this issue.
https://github.com/baflQA/selenium-debug/blob/main/src/test/java/seleniumdebug/BiDiPlaygroundTest.java
After running this test, in the console there will be many errors like:

Caused by: org.openqa.selenium.json.JsonException: Unable to find type coercer for class org.openqa.selenium.Cookie
Build info: version: '4.16.1', revision: '9b4c83354e'
System info: os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '14.1.2', java.version: '17.0.9'
Driver info: driver.version: unknown
	at org.openqa.selenium.json.JsonTypeCoercer.lambda$buildCoercer$8(JsonTypeCoercer.java:173)
	at java.base/java.util.Optional.orElseThrow(Optional.java:403)
	at org.openqa.selenium.json.JsonTypeCoercer.buildCoercer(JsonTypeCoercer.java:173)
	at java.base/java.util.concurrent.ConcurrentHashMap.computeIfAbsent(ConcurrentHashMap.java:1740)
	at org.openqa.selenium.json.JsonTypeCoercer.coerce(JsonTypeCoercer.java:142)
	at org.openqa.selenium.json.CollectionCoercer.lambda$apply$0(CollectionCoercer.java:63)
	at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197)
	at java.base/java.util.Iterator.forEachRemaining(Iterator.java:133)
	at java.base/java.util.Spliterators$IteratorSpliterator.forEachRemaining(Spliterators.java:1845)
	at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509)
	at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499)
	at java.base/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:921)
	at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
	at java.base/java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:682)
	at org.openqa.selenium.json.CollectionCoercer.lambda$apply$1(CollectionCoercer.java:64)
	at org.openqa.selenium.json.JsonTypeCoercer.lambda$buildCoercer$6(JsonTypeCoercer.java:171)
	at org.openqa.selenium.json.JsonTypeCoercer.coerce(JsonTypeCoercer.java:146)
	at org.openqa.selenium.json.JsonInput.read(JsonInput.java:423)
	at org.openqa.selenium.bidi.network.RequestData.fromJson(RequestData.java:84)

present.
As a result, it won't be able to capture some of the requests.

Relevant log output

Caused by: org.openqa.selenium.json.JsonException: Unable to find type coercer for class org.openqa.selenium.Cookie
Build info: version: '4.16.1', revision: '9b4c83354e'
System info: os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '14.1.2', java.version: '17.0.9'
Driver info: driver.version: unknown
	at org.openqa.selenium.json.JsonTypeCoercer.lambda$buildCoercer$8(JsonTypeCoercer.java:173)
	at java.base/java.util.Optional.orElseThrow(Optional.java:403)
	at org.openqa.selenium.json.JsonTypeCoercer.buildCoercer(JsonTypeCoercer.java:173)
	at java.base/java.util.concurrent.ConcurrentHashMap.computeIfAbsent(ConcurrentHashMap.java:1740)
	at org.openqa.selenium.json.JsonTypeCoercer.coerce(JsonTypeCoercer.java:142)
	at org.openqa.selenium.json.CollectionCoercer.lambda$apply$0(CollectionCoercer.java:63)
	at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197)
	at java.base/java.util.Iterator.forEachRemaining(Iterator.java:133)
	at java.base/java.util.Spliterators$IteratorSpliterator.forEachRemaining(Spliterators.java:1845)
	at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509)
	at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499)
	at java.base/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:921)
	at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
	at java.base/java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:682)
	at org.openqa.selenium.json.CollectionCoercer.lambda$apply$1(CollectionCoercer.java:64)
	at org.openqa.selenium.json.JsonTypeCoercer.lambda$buildCoercer$6(JsonTypeCoercer.java:171)
	at org.openqa.selenium.json.JsonTypeCoercer.coerce(JsonTypeCoercer.java:146)
	at org.openqa.selenium.json.JsonInput.read(JsonInput.java:423)
	at org.openqa.selenium.bidi.network.RequestData.fromJson(RequestData.java:84)

Operating System

macOS, Linux

Selenium version

4.16.1

What are the browser(s) and version(s) where you see this issue?

Chrome 120

What are the browser driver(s) and version(s) where you see this issue?

Chromedriver 120

Are you using Selenium Grid?

not relevant

Copy link

@baflQA, thank you for creating this issue. We will troubleshoot it as soon as we can.


Info for maintainers

Triage this issue by using labels.

If information is missing, add a helpful comment and then I-issue-template label.

If the issue is a question, add the I-question label.

If the issue is valid but there is no time to troubleshoot it, consider adding the help wanted label.

If the issue requires changes or fixes from an external project (e.g., ChromeDriver, GeckoDriver, MSEdgeDriver, W3C), add the applicable G-* label, and it will provide the correct link and auto-close the issue.

After troubleshooting the issue, please add the R-awaiting answer label.

Thank you!

@titusfortner titusfortner added C-java C-devtools BiDi or Chrome DevTools related issues labels Dec 15, 2023
@pujagani pujagani self-assigned this Dec 15, 2023
pujagani added a commit to pujagani/selenium that referenced this issue Dec 18, 2023
Copy link

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.

@github-actions github-actions bot locked and limited conversation to collaborators Jan 18, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
C-devtools BiDi or Chrome DevTools related issues C-java I-defect needs-triaging
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants