-
-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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
Null pointer exception when calling webDriver.findElements #4555
Comments
Actually, it's a chromedriver issue. It must return a list of web elements (or an empty list) on this operation. But sometimes it breaks the contract and returns null. Sigh So we have to be more defensive and convert null to an empty list on the client side. All language bindings can suffer from this issue. |
…he result of findElements operation. See #4555
Fixed in Java binding by 4a3ec2d |
Thanks @barancev! |
What release will this be in? |
Fixed in Ruby bindings in d4d8433. |
Does this only affect |
Fixed in python 4fcce6e |
…he result of findElements operation. See SeleniumHQ#4555
A moment ago (but don't reproduce): InternetExplorerDriver server (32-bit) 3.6.0.0
Maybe it returns list of null(s)? |
In Selenium 3.14.0, I see cases where |
…lementWrapper RestResponse - Added Class. WebDriverWrapper - Added BrowserType enum. - Added BROWSER_TYPE constant. - Added workaround for Bug: Null pointer exception when calling webDriver.findElements #4555 <SeleniumHQ/selenium#4555>. WebElementTransitionalWrapper - Added constructor for that takes in a WebElementWrapper. WebElementWrapper - Added controlCommandClick(), doubleClick(), keyClick(CharSequence), and getCssValue(String _propertyName), rightClick(), & rightClickAndSelectContextMenuItem(int) methods. - Added ReAcquire chatch to all "Perform Actions" calls. v1.3.0-SNAPSHOT
It seems it was implemented in all bindings except .NET, in case any one finds an issue there, please open a new issue. |
The problem for me was that the path to find chrome browser was missing ".exe" in it. I'm referring to the "VM options:" in Run>Edit Configurations>JDK Settings -Dwebdriver.chrome.driver="D:\Work\Softwares\chromedriver_win32.\chromedriver.exe" |
Meta -
OS: OSX
Selenium Version: 3.3.1, IntelliJ
Browser: Chrome 60
Browser Version:
Version 60.0.3112.90 (Official Build) (64-bit)
Expected Behavior -
No null pointer exception when calling
webDriver.findElements
Actual Behavior -
Occasionally, calling
webDriver.findElements(By.cssSelector(query))
causes a null pointer exception. Here is the stack trace:Steps to reproduce -
It seems to happen only rarely happen so it's hard to reliably reproduce. I think it is a race condition. There was a recently a report of a similar issue in: #4375
The text was updated successfully, but these errors were encountered: