Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ChromeDriver 131 sends undefined arguments to JavascriptExecutor when arguments are type WebElement #162

Open
MxyL opened this issue Nov 19, 2024 · 1 comment

Comments

@MxyL
Copy link

MxyL commented Nov 19, 2024

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.

@MxyL
Copy link
Author

MxyL commented 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant