My eventual goal is to write a procedure to automate clearing some parts of my browser data. However, I’m having trouble getting to first base. I haven’t worked with Shadow Roots until now. Does anyone see what I’m doing to raise a Type mismatch error in the following code?
Public Sub TestShadowRoot()
Dim aCD As Selenium.ChromeDriver
Dim aShadowHost As Selenium.WebElement
Dim aShadowRoot As Selenium.WebElement
On Error GoTo ErrorHandler
Set aCD = New Selenium.ChromeDriver
Call aCD.Get("chrome://settings/clearBrowserData")
Set aShadowHost = aCD.FindElementByTag("settings-ui")
Set aShadowRoot = aCD.ExecuteScript( _
Script:="return arguments[0].shadowRoot", _
arguments:=aShadowHost)
Exit Sub
ErrorHandler:
Debug.Print (Err.Description)
End Sub
I expected the test code to return aShadowRoot Web Element. Instead, I got a Type mismatch error.
2