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

CLAassistant commented Apr 2, 2026

CLA assistant check
All committers have signed the CLA.

@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

@asolntsev asolntsev modified the milestones: 4.42.0, 4.43.0 Apr 9, 2026
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