You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am using Selenium v. 4.13
I have a shadow-root element, holding a complex account tree structure. It is required to validate that tree nodes have been rendered properly, according to account hierarchy, so that one element is above another, to the left or to the right.
Relative Locators in Selenium 4 are the ideal validation path, but trying to call findElement/s with relative locators throws the exception below:
java.lang.IllegalArgumentException: Context does not provide a mechanism to execute JS:
Result: java.lang.IllegalArgumentException: Context does not provide a mechanism to execute JS: org.openqa.selenium.remote.ShadowRoot@5dbd1f7e
at org.openqa.selenium.By.getJavascriptExecutor (By.java:153)
at org.openqa.selenium.support.locators. RelativeLocator $RelativeBy.findElements (RelativeLocator.java:190)
The text was updated successfully, but these errors were encountered:
@ghitarist, thank you for creating this issue. We will troubleshoot it as soon as we can.
Info for maintainers
Triage this issue by using labels.
If information is missing, add a helpful comment and then I-issue-template label.
If the issue is a question, add the I-question label.
If the issue is valid but there is no time to troubleshoot it, consider adding the help wanted label.
If the issue requires changes or fixes from an external project (e.g., ChromeDriver, GeckoDriver, MSEdgeDriver, W3C),
add the applicable G-* label, and it will provide the correct link and auto-close the
issue.
After troubleshooting the issue, please add the R-awaiting answer label.
Feature and motivation
I am using Selenium v. 4.13
I have a shadow-root element, holding a complex account tree structure. It is required to validate that tree nodes have been rendered properly, according to account hierarchy, so that one element is above another, to the left or to the right.
Relative Locators in Selenium 4 are the ideal validation path, but trying to call findElement/s with relative locators throws the exception below:
java.lang.IllegalArgumentException: Context does not provide a mechanism to execute JS:
Usage example
SearchContext shadowRoot = driver.findElement(shadowLocator).getShadowRoot();
elementList = shadowRoot.findElements(with(rootLocator).above(aboveLocator));
Result:
java.lang.IllegalArgumentException: Context does not provide a mechanism to execute JS: org.openqa.selenium.remote.ShadowRoot@5dbd1f7e
at org.openqa.selenium.By.getJavascriptExecutor (By.java:153)
at org.openqa.selenium.support.locators. RelativeLocator $RelativeBy.findElements (RelativeLocator.java:190)
The text was updated successfully, but these errors were encountered: