-
-
Notifications
You must be signed in to change notification settings - Fork 8.6k
Closed
Labels
A-needs-triagingA Selenium member will evaluate this soon!A Selenium member will evaluate this soon!I-defectSomething is not working as intendedSomething is not working as intended
Description
What happened?
The BiDi type Scipt.LocalValue.Map should be passable to the Script.CallFunctionAsync method. However, it fails with a strange exception.
Per the spec, the Map is serialized the same was an Object is:

An Object is an IEnumerable<IEnumerable<LocalValue>>, and works fine in this scenario. For that reason, I am suspicious if Map should be changed into the same shape.
Same thing applies for the returned RemoteValue.Map.
How can we reproduce the issue?
#
var bidi = await driver.AsBiDiAsync();
var context = (await bidi.BrowsingContext.GetTreeAsync())[0].Context;
var map = new LocalValue.Map(new Dictionary<string, LocalValue>
{
{"key", new LocalValue.String("value") }
});
var response = await context.Script.CallFunctionAsync($$"""
(arg) => {
return arg;
}
""", false, new() { Arguments = [map] });Relevant log output
Message:
OpenQA.Selenium.BiDi.BiDiException : invalid argument: Invalid input in "arguments"/0.
Stack Trace:
Broker.ExecuteCommandCoreAsync[TCommand](TCommand command, CommandOptions options) line 216
Broker.ExecuteCommandAsync[TCommand,TResult](TCommand command, CommandOptions options) line 186Operating System
N/A
Selenium version
trunk
What are the browser(s) and version(s) where you see this issue?
chrome 133.0.6943.143
What are the browser driver(s) and version(s) where you see this issue?
chromedriver 133.0.6943.141
Are you using Selenium Grid?
No response
Metadata
Metadata
Assignees
Labels
A-needs-triagingA Selenium member will evaluate this soon!A Selenium member will evaluate this soon!I-defectSomething is not working as intendedSomething is not working as intended