'Problem interacting with Shadow Dom with Selenium in Node.js

I have a website ingbusiness.pl/gib/login, I need to basically log in (send keys, and then click the orange button). When I try to execute such function:

 async function getExtShadowRoot() { 
let shadowHost;
shadowHost = await driver.findElement(By.css("ing-app-gib-main")); 
return await shadowHost.executeScript("return arguments[0].shadowRoot")} }

I get error TypeError: shadowHost.executeScript is not a function

How to access the shadowRoot?



Solution 1:[1]

use driver instead of shadowHost to executeScript.

return await drive.executeScript("return arguments[0].shadowRoot",shadowHost );

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Padmabhushan Durge