[java] Change BiDi "internalId" type from Long to String#16918
[java] Change BiDi "internalId" type from Long to String#16918asolntsev merged 1 commit intoSeleniumHQ:trunkfrom
Conversation
In BiDi spec, its type is "TEXT".
Latest FireFox 147.0 returns UUID in field "internalId":
{
"type" : "node",
"sharedId" : "5dd958fd-0033-4b3a-b06a-f9eec9db2c85",
"value" : { ... },
"internalId" : "df8e0744-b1db-49b2-96df-45bd0d70dcd3"
}
PR Compliance Guide 🔍Below is a summary of compliance checks for this PR:
Compliance status legend🟢 - Fully Compliant🟡 - Partial Compliant 🔴 - Not Compliant ⚪ - Requires Further Human Verification 🏷️ - Compliance label |
||||||||||||||||||||||||
PR Code Suggestions ✨Explore these optional code suggestions:
|
|||||||||||||||
Example of JSON parsing exception that was not clean enough: ``` org.openqa.selenium.json.JsonException: java.lang.NumberFormatException: Character array is missing "e" notation exponential mark. Build info: version: '4.40.0-SNAPSHOT', revision: '048a50178d*' System info: os.name: 'Mac OS X', os.arch: 'aarch64', os.version: '26.2', java.version: '17.0.17' Driver info: driver.version: unknown at org.openqa.selenium.json.NumberCoercer.lambda$apply$0(NumberCoercer.java:68) 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:428) at org.openqa.selenium.bidi.script.RemoteValue.fromJson(RemoteValue.java:136) ... 53 more Caused by: java.lang.NumberFormatException: Character array is missing "e" notation exponential mark. at java.base/java.math.BigDecimal.<init>(BigDecimal.java:645) at java.base/java.math.BigDecimal.<init>(BigDecimal.java:471) at java.base/java.math.BigDecimal.<init>(BigDecimal.java:900) at org.openqa.selenium.json.NumberCoercer.lambda$apply$0(NumberCoercer.java:66) ``` See SeleniumHQ#16918
* Report exactly which JSON value was incorrect Example of JSON parsing exception that was not clean enough: ``` org.openqa.selenium.json.JsonException: java.lang.NumberFormatException: Character array is missing "e" notation exponential mark. Build info: version: '4.40.0-SNAPSHOT', revision: '048a50178d*' System info: os.name: 'Mac OS X', os.arch: 'aarch64', os.version: '26.2', java.version: '17.0.17' Driver info: driver.version: unknown at org.openqa.selenium.json.NumberCoercer.lambda$apply$0(NumberCoercer.java:68) 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:428) at org.openqa.selenium.bidi.script.RemoteValue.fromJson(RemoteValue.java:136) ... 53 more Caused by: java.lang.NumberFormatException: Character array is missing "e" notation exponential mark. at java.base/java.math.BigDecimal.<init>(BigDecimal.java:645) at java.base/java.math.BigDecimal.<init>(BigDecimal.java:471) at java.base/java.math.BigDecimal.<init>(BigDecimal.java:900) at org.openqa.selenium.json.NumberCoercer.lambda$apply$0(NumberCoercer.java:66) ``` See #16918 * fix flaky test CombinedInputActionsTest.canMoveMouseToAnElementInAnIframeAndClick() Failure example: ``` canMoveMouseToAnElementInAnIframeAndClick() (org.openqa.selenium.interactions.CombinedInputActionsTest) org.openqa.selenium.WebDriverException: InactiveActor: Actor is no longer active Build info: version: '4.41.0-SNAPSHOT', revision: 'Unknown' System info: os.name: 'Linux', os.arch: 'amd64', os.version: '6.1.0-42-cloud-amd64', java.version: '21.0.4' Driver info: org.openqa.selenium.firefox.FirefoxDriver Command: [f2b94f3c-a2cc-43b0-b869-6b313b9515b1, actions {actions=[org.openqa.selenium.interactions.Sequence@562919fe]}] Capabilities {acceptInsecureCerts: true, browserName: firefox, browserVersion: 148.0, moz:accessibilityChecks: false, moz:buildID: 20260123090351, moz:geckodriverVersion: 0.36.0, moz:headless: false, moz:platformVersion: 6.1.0-42-cloud-amd64, moz:processID: 12338, moz:profile: /tmp/rust_mozprofileC1s3za, moz:shutdownTimeout: 60000, moz:webdriverClick: true, moz:windowless: false, pageLoadStrategy: normal, platformName: linux, proxy: Proxy(), setWindowRect: true, strictFileInteractability: false, timeouts: {implicit: 0, pageLoad: 300000, script: 30000}, unhandledPromptBehavior: dismiss and notify, userAgent: Mozilla/5.0 (X11; Linux x86..., webSocketUrl: ws://127.0.0.1:42879/sessio...} Session ID: f2b94f3c-a2cc-43b0-b869-6b313b9515b1 at org.openqa.selenium.remote.ErrorCodec.decode(ErrorCodec.java:169) at org.openqa.selenium.remote.codec.w3c.W3CHttpResponseCodec.decode(W3CHttpResponseCodec.java:142) at org.openqa.selenium.remote.codec.w3c.W3CHttpResponseCodec.decode(W3CHttpResponseCodec.java:49) at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:223) at org.openqa.selenium.remote.service.DriverCommandExecutor.invokeExecute(DriverCommandExecutor.java:216) at org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:174) at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:602) at org.openqa.selenium.remote.RemoteWebDriver.perform(RemoteWebDriver.java:697) at org.openqa.selenium.interactions.Actions$BuiltAction.perform(Actions.java:616) at org.openqa.selenium.interactions.Actions.perform(Actions.java:581) at org.openqa.selenium.interactions.CombinedInputActionsTest.canMoveMouseToAnElementInAnIframeAndClick(CombinedInputActionsTest.java:251) ```
@diemol @titusfortner We need to get this fix to 4.40.0 release.
User description
In BiDi spec, its type is "TEXT".
Latest FireFox 147.0 returns UUID in field "internalId":
{ "type" : "node", "sharedId" : "5dd958fd-0033-4b3a-b06a-f9eec9db2c85", "value" : { ... }, "internalId" : "df8e0744-b1db-49b2-96df-45bd0d70dcd3" }Stack trace:
🔄 Types of changes
PR Type
Bug fix
Description
Change BiDi
internalIdfield type fromLongtoStringAlign with BiDi specification where type is TEXT
Support Firefox 147.0+ UUID format for
internalIdDiagram Walkthrough
File Walkthrough
RemoteValue.java
Update internalId field type to Stringjava/src/org/openqa/selenium/bidi/script/RemoteValue.java
internalIdfield type fromOptionaltoOptionalinternalIdfromJson()method to deserializeinternalIdasStringinsteadof
LonggetInternalId()getter return type toOptional