Permission denied to access property "shadowRoot"


When I try setting Test Object like

and running a test using verifyElementPresent in firefox .

However return error like below.

How can I handle shadow dom in firefox ?

Could you please show me this.

Thanks .

at com.kms.katalon.core.webui.keyword.internal.WebUIKeywordMain.stepFailed(WebUIKeywordMain.groovy:64)

at com.kms.katalon.core.webui.keyword.internal.WebUIKeywordMain.runKeyword(WebUIKeywordMain.groovy:26)

at com.kms.katalon.core.webui.keyword.internal.WebUIKeywordMain$ Source)

at com.kms.katalon.core.webui.keyword.builtin.WaitForElementVisibleKeyword.waitForElementVisible(WaitForElementVisibleKeyword.groovy:98)

at com.kms.katalon.core.webui.keyword.builtin.WaitForElementVisibleKeyword.execute(WaitForElementVisibleKeyword.groovy:68)

at com.kms.katalon.core.keyword.internal.KeywordExecutor.executeKeywordForPlatform(KeywordExecutor.groovy:72)

at com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords.waitForElementVisible(WebUiBuiltInKeywords.groovy:434)

at com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords$waitForElementVisible$ Source)

at editor.click_pluss.clickPluss(click_pluss.groovy:33)

at editor.click_pluss.invokeMethod(click_pluss.groovy)

at com.kms.katalon.core.main.CustomKeywordDelegatingMetaClass.invokeStaticMethod(



at com.kms.katalon.core.main.ScriptEngine.runScriptAsRawText(

at com.kms.katalon.core.main.TestCaseExecutor.runScript(

at com.kms.katalon.core.main.TestCaseExecutor.doExecute(

at com.kms.katalon.core.main.TestCaseExecutor.processExecutionPhase(

at com.kms.katalon.core.main.TestCaseExecutor.accessMainPhase(

at com.kms.katalon.core.main.TestCaseExecutor.execute(

at com.kms.katalon.core.main.TestSuiteExecutor.accessTestCaseMainPhase(

at com.kms.katalon.core.main.TestSuiteExecutor.accessTestSuiteMainPhase(

at com.kms.katalon.core.main.TestSuiteExecutor.execute(

at com.kms.katalon.core.main.TestCaseMain.startTestSuite(

at com.kms.katalon.core.main.TestCaseMain$startTestSuite$ Source)


Caused by: org.openqa.selenium.JavascriptException: Error: Permission denied to access property "shadowRoot"

Hello @sura

Working with Shadow DOM Objects in Katalon Studio has the following known limitations:

  • Only for Chrome browser (53 to latest version). Other browsers will be considered for future releases.
  • Only allow 1 level of nested Shadow DOM parent
  • Record and Spy feature will not work with Shadow DOM (since elements do not exist in the DOM).


Hi @Jass

Thank you for answering.

Hi @Jass ,

May I ask you again ?

I want to handle shadow dom using css selector .
Specifically, I want to use nth-child .

Could you please give me some advices ?

Thanks .

@sura You might want to check out:
In there Git Hub Repo are some samples also to get you on your way.

Looks like you have errors in both Element references and this Scope (in You injected the template into a Component document can not access elements inside any Component shadowDOM doesn't matter if the shadowDOM is mode:closed or mode:open

The #inside{ color:green; } one major issue: will only execute for the first used element!!

I didn’t write this of the top of my head,
(Work in progess) JSFiddle playground (also showing referencing Component methods) at:

Update #1
Chromium (Edge/Chrome) and Opera are fine, FireFox v72.0.2 misbehaves:

the onload on a element will only fire for the first element
I changed the JSFiddle to use your first hack using an , and it fires for every element

templFunc() is loaded/scoped in shadowDOM, so is callable from component methods (see JSFiddle)
but… only in FireFox is NOT defined/available for the first element
For now I consider this a FireFox bug… will investigate further… (to boldly go where…)

!!! Update #2 !!!
OOPS! Played some more with it.

Turns out all variables and functions from a cloned and imported SCRIPT
are hoisted to the global window scope

So above code works, but has a major side-effect…

That is also why FireFox complains about re- declaring let variables


Thanks for replying .

I am facing some issue while interacting with Shadow Dom "it has took 30sceonds to interacting any webelement " is there any wat to achieve fast /