Update elements finders python docs#2099
Conversation
Moving the code to the appropriate files
✅ Deploy Preview for selenium-dev ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Explore these optional code suggestions:
|
Match trunk's current inline Python snippet for this one tab exactly so a trunk merge has no conflict here. A follow-up commit restores the gh-codeblock reference once the merge lands. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
✅ Deploy Preview for selenium-dev ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Code Review by Qodo
Context used✅ Compliance rules (platform):
10 rules 1.
|
Now that the trunk sync landed, restore the Python tab to reference test_finders.py instead of the inline snippet that was kept temporarily to avoid a merge conflict. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
|
Code review by qodo was updated up to the latest commit c4c51f6 |
- Mirror the doc's "tomatoes/fruits" HTML snippet for the illustrative sections (basic finder, subset of DOM, optimized locator, all matching elements), matching Java/C#/JS/Kotlin/Ruby exactly. These are marked pytest.mark.skip since no live fixture page implements that HTML, the same approach already used by finders_spec.rb in Ruby. - Fix a real XPath-scoping bug: find_elements_from_element used an absolute XPath (//ul) from an element, which searches the whole document instead of scoping to it, contradicting its own comment. Replaced with the simple TAG_NAME div/p pattern that Java/C#/JS/Ruby already use for this section. - Replace brittle selectors tied to the live selenium.dev homepage layout (.td-home, #announcement-banner, .nav-item.dropdown) with example.com and the existing web-form.html/shadowRootPage.html fixtures already used elsewhere in these examples. Verified: all 8 tests collect, the 4 runnable ones pass against real Chrome, the 4 illustrative ones report skipped. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
|
Code review by qodo was updated up to the latest commit 9ca4b34 |
- Accept the driver fixture parameter in the skipped illustrative tests instead of referencing an undefined name, so the snippets aren't one edit away from a NameError if someone unskips them. - Check test_evaluating_shadow_dom's shadow_root truthiness before using it to look up shadow_content, instead of after, so a missing shadow root fails at the assertion instead of an AttributeError deeper in. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
|
Code review by qodo was updated up to the latest commit 6eb6f9f |
User description
Thanks for contributing to the Selenium site and documentation!
A PR well described will help maintainers to review and merge it quickly
Before submitting your PR, please check our contributing guidelines.
Avoid large PRs, and help reviewers by making them as simple and short as possible.
Description
Moving code examples from the .md files to the .py files for elements/finders
Motivation and Context
Keeps code in a single place.
Types of changes
Checklist
PR Type
Enhancement, Documentation
Description
Added comprehensive test suite for Selenium element finders in Python:
Updated documentation across multiple languages:
Improved code organization by:
Changes walkthrough 📝
test_finders.py
Add comprehensive test suite for Selenium element findersexamples/python/tests/elements/test_finders.py
and active elements
elements
and quit
finders.en.md
Update Python code examples in element finders documentationwebsite_and_docs/content/documentation/webdriver/elements/finders.en.md
finders.ja.md
Sync Japanese documentation with updated Python exampleswebsite_and_docs/content/documentation/webdriver/elements/finders.ja.md
finders.pt-br.md
Sync Portuguese documentation with updated Python exampleswebsite_and_docs/content/documentation/webdriver/elements/finders.pt-br.md
finders.zh-cn.md
Sync Chinese documentation with updated Python exampleswebsite_and_docs/content/documentation/webdriver/elements/finders.zh-cn.md