florentbr/SeleniumBasic

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

KDRende opened this issue · 1 comments

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?