Skip to content

[🐛 Bug]: [dotnet] BiDi LocalValue.Map cannot be passed to the Script.CallFunctionAsync command #15394

@RenderMichael

Description

@RenderMichael

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:
Image

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 186

Operating 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

No one assigned

    Labels

    A-needs-triagingA Selenium member will evaluate this soon!I-defectSomething is not working as intended

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions