Will it work for Webdriver 3.x & Chrome v 96+ #53
Unanswered
madhavchoudhary83
asked this question in
Q&A
Replies: 1 comment 1 reply
-
@madhavchoudhary83 And this in your browser console? If the 2nd output is blank then we need to understand the DOM first to find a unique way to get Element. Else you can debug it and raise a bug with your DOM snapshot. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Will it work for Webdriver 3.x & Chrome v 96+, or we need to upgrade webdriver to 4.x to utilize this solution ? I red that there are fixes made in webdriver 4.x to get the shadow root in Chrome 96 and above.
I tried to use the solution but its unable to get webelement for the parent (shadowhost) as well as elements under the parent.
With core webdriver findelement method, the same shadow host is getting detected.
WebElement parent1 = this.driver.findElement(By.cssSelector("#search")); System.out.println("XXXXXXXXXXXXXXXXXXXXXXXXX "+ parent1.isDisplayed()); Shadow shadow = new Shadow( this.driver); WebElement parent = shadow.findElementByXPath("//*[@id='search']"); // WebElement parent = shadow.findElement("#search"); // WebElement searchTextbox = shadow.findElement("input[placeholder='Search']"); WebElement searchTextbox = shadow.findElement(parent, "input[placeholder='Search']");
In above code snippet, line 1 works however, line 4 not working also , tried with line 6 & 7 and that also fails at 6.
Failing as NoSuchElementException
Beta Was this translation helpful? Give feedback.
All reactions