Skip to content

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

Open
@MxyL

Description

@MxyL

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

MxyL commented on Nov 19, 2024

@MxyL
Author

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @MxyL

        Issue actions

          ChromeDriver 131 sends undefined arguments to JavascriptExecutor when arguments are type WebElement · Issue #162 · GoogleChromeLabs/chrome-for-testing