Skip to content

[java] fix NoSuchElementException for custom By locators#17287

Open
Chandan25sharma wants to merge 3 commits intoSeleniumHQ:trunkfrom
Chandan25sharma:MRSA
Open

[java] fix NoSuchElementException for custom By locators#17287
Chandan25sharma wants to merge 3 commits intoSeleniumHQ:trunkfrom
Chandan25sharma:MRSA

Conversation

@Chandan25sharma
Copy link
Copy Markdown

@Chandan25sharma Chandan25sharma commented Apr 1, 2026

💥 What does this PR do?

Modified ElementLocation to throw NoSuchElementException when a context-based finder returns null. Ensures symmetry with the remote finder and maintains backward compatibility for custom locators.

🔧 Implementation Notes

💡 Additional Considerations

🔄 Types of changes

  • Bug fix (backwards compatible)

@selenium-ci selenium-ci added the C-java Java Bindings label Apr 1, 2026
Modified ElementLocation to throw NoSuchElementException when a context-based finder returns null.
Ensures symmetry with the remote finder and maintains backward compatibility for custom locators.
render_diffs(file:///d:/projects/selenium/java/src/org/openqa/selenium/remote/ElementLocation.java) render_diffs(file:///d:/projects/selenium/rb/lib/selenium/webdriver/common/websocket_connection.rb) render_diffs(file:///d:/projects/selenium/rb/lib/selenium/webdriver/devtools/network_interceptor.rb) render_diffs(file:///d:/projects/selenium/rb/lib/selenium/webdriver/common/driver_extensions/has_network_interception.rb)
@asolntsev asolntsev added this to the 4.42.0 milestone Apr 2, 2026
@CLAassistant
Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
1 out of 2 committers have signed the CLA.

✅ cgoldberg
❌ Chandan25sharma
You have signed the CLA already but the status is still pending? Let us recheck it.

@cgoldberg
Copy link
Copy Markdown
Member

@Chandan25sharma please sign the CLA: #17287 (comment)

@Chandan25sharma
Copy link
Copy Markdown
Author

thanks i have signed to licence

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

C-java Java Bindings

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants