Skip to content

VBA .ExecuteScript("return arguments[0].shadowRoot" returns type Dictionary, not type WebElement #280

@KDRende

Description

@KDRende

Good day I am using Chrome Selenium in Access VBA and hit an problem that I can't find anybody else reporting. It goes:

Dim CD as New Selenium.ChromeDriver
Dim SH As Selenium.WebElement ' ShadowHost
Dim SR As Selenium.WebElement ' ShadowRoot

CD.Start
CD.Get [Link to my Home Assistant] ' < - works
Set SH = CD.FindElementByCss("body > home-assistant") ' Webelement ' <- works

' (1) The following fails as "Type Mismatch" for SR
' (2) If SR defined as Variant, it succeeds but returns as Dictionary, not WebElement

Set SR = CD.ExecuteScript("return arguments[0].shadowRoot", SH) ' < - SR fails as WebElement, works as Variant returning Dictionary

Any insights into this problem?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions