Open
Description
Describe the bug
In Java Selenium WebDriver 2, we click elements by obtaining a WebElement reference using driver.findElement( ... ) and then we use javascript executor to call the click method.
This works fine in 130. Since updating to 131, clicking no longer works, with the following error reported
org.openqa.selenium.WebDriverException: javascript error: Cannot read properties of undefined (reading 'click')
To reproduce
I print to console the number of elements found and what the elements are.
List<WebElement> elmts = driver.findElements(By.xpath(YOUR_XPATH));
(JavascriptExecutor) driver).executeScript("console.log(arguments[0])", elmts.size());
(JavascriptExecutor) driver).executeScript("console.log(arguments[0])", elmts);
Expected behavior
I should see the number of elements, along with an array of the specified elements.
It does print the correct number of elements, but it's simply an array of undefined.
Activity
MxyL commentedon Nov 19, 2024
This was using the stable release 131.0.6778.69
I tried an older deployment 131.0.6724.0 and the issue does not appear to happen.