Skip to content

D5: Outdated Selenium patterns page - #2903

Open
AutomatedTester wants to merge 3 commits into
trunkfrom
site/d5-outdated-patterns
Open

AutomatedTester wants to merge 3 commits into
trunkfrom
site/d5-outdated-patterns

Conversation

@AutomatedTester

@AutomatedTester AutomatedTester commented Oct 12, 2026 •

Copy link
Copy Markdown
Member

Merge note: D1 and D5 both perform the same rename, documentation/ai_agents.en.md to documentation/ai_agents/_index.en.md. Here it is an unmodified rename (0 lines changed). Whichever merges second needs a trivial rebase; keep the D1 version of _index.en.md.

What changed

  • New website_and_docs/content/documentation/ai_agents/outdated_patterns.en.md (title "Outdated Selenium patterns and their current replacements", linkTitle "Outdated Patterns", weight 2).
  • Unmodified rename ai_agents.en.md to ai_agents/_index.en.md (see merge note).
  • One H2 per pattern, each with a bold "outdated since" note, a short reason, a tabpane with the outdated form in a plain fenced block whose first line is // Outdated — do not use or # Outdated — do not use, and the current form via gh-codeblock:
    • DesiredCapabilities (Java, Python) to browser Options
    • Manual driver downloads and driver managers (Java, Python) to Selenium Manager
    • sleep() (Java, Python) to explicit waits
    • Absolute XPath (Java, Python) to stable locators and relative locators
    • find_element_by_* (Java, Python) to find_element(By...)
    • executable_path (Python) to Service
    • CDP-only calls (Java, Python) to WebDriver BiDi
  • New examples, because none existed for relative locators: examples/java/src/test/java/dev/selenium/elements/RelativeLocatorTest.java and examples/python/tests/elements/test_relative_locators.py (login page, below(username-field) finds password-field).

Why

Plan item D5: a "wrong vs right" reference that the AI agents page (D1) points at, so a reviewer can recognise stale agent output and see the replacement.

Acceptance criteria

  • Front matter as specified.
  • Intro paragraph, then one H2 per required pattern (7 of 7).
  • Each outdated snippet is a plain fenced block with a "do not use" comment as its first line.
  • Current forms reference examples/ with gh-codeblock; every line range checked against the files on this branch.
  • Every version claim is sourced in this repo:
    • DesiredCapabilities: upgrade guide ("Selenium 4 removes support for the legacy protocol", W3C by default) and blog 2024/selenium-4-17-released.md (Java no longer accepts desiredCapabilities session requests).
    • Selenium Manager 4.6 and browser management 4.11: documentation/selenium_manager.en.md.
    • find_element_by_*: blog 2022/python-locators-se4.md ("sometime after Selenium 4.2" for removal) and the upgrade guide (Java findElementBy* removed).
    • executable_path: upgrade guide ("deprecated, pass in a Service object").
    • CDP: bidi/cdp/_index.en.md ("temporary until WebDriver BiDi") and blog 2025/remove-cdp-firefox.md (Firefox CDP deprecated in 4.27 and 4.28, removed in 4.29).
    • sleep and absolute XPath carry no version ("Never good practice"); the AI agents blog post says they were bad advice in 2013.
  • Not claimed: the Python removal releases "4.3" (find_element_by_*) and "4.10" (executable_path) that appear in the existing AI agents rules tabs. The repo's blog and upgrade guide do not confirm those numbers, so this page says "removal announced after 4.2" and "deprecated in Selenium 4" instead. Worth a check by whoever knows the changelog.
  • Builds without warnings; page at /documentation/ai_agents/outdated_patterns/; sidebar shows "AI Agents" with child "Outdated Patterns".
  • The new example tests were not run (no browser available here). Both only py_compile/read-checked. Please run pytest tests/elements/test_relative_locators.py and mvn test -Dtest=RelativeLocatorTest; the assertion relies on login.html having username-field directly above password-field.
  • gh-codeblock fetches from GitHub trunk, so the two new examples render "not found" in a preview until this branch merges.

Translated pages affected

None. The new page is English only. ai_agents has no ja/pt-br/zh-cn pages.

Checks run

  • Scratchpad build helper: no ERROR or WARN.
  • Output has documentation/ai_agents/outdated_patterns/index.html, title as specified, 14 "Outdated — do not use" markers.
  • python3 -m py_compile on the new Python test.
  • Cross-reference targets (options, selenium_manager, waits, locators, service, upgrade_to_selenium_4, bidi/cdp, bidi/w3c, blog python-locators) all resolved by ref during the build.

Disclosure

Prepared with Claude (Anthropic); the author reviewed and edited all content.



Generated by Claude Code

Add documentation/ai_agents/outdated_patterns.en.md: for each
Selenium 2/3 idiom that agents reproduce (DesiredCapabilities,
manual drivers, sleep, absolute XPath, find_element_by_*,
executable_path, CDP-only calls) show the outdated form, when it was
superseded, and the current form referenced from examples/.

Add Java and Python relative locator examples, since none existed.

The page needs a section directory, so this also renames
ai_agents.en.md to ai_agents/_index.en.md unchanged. D1 does the same
rename; whichever lands second needs a trivial rebase.
@netlify

netlify Bot commented Oct 12, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for selenium-dev ready!

Name Link
🔨 Latest commit 18b0206
🔍 Latest deploy log https://app.netlify.com/projects/selenium-dev/deploys/6acced44ac1fc6b57ee49fb1
😎 Deploy Preview https://deploy-preview-2903--selenium-dev.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

Drop the two new example tests, which were not run and depend on
the layout of the login page, and show the relative locator form
inline as the Locators page already does.

Copy link
Copy Markdown
Member Author

Superseded: the Phase 1 items are being regrouped into one PR per workstream to make the layout easier to review as a whole. This branch's commit is carried over unchanged.


Generated by Claude Code

Copy link
Copy Markdown
Member Author

Reopened. Part of the selenium.dev modernisation set; see #2912 for the full list and suggested review order.


Generated by Claude Code

@AutomatedTester
AutomatedTester marked this pull request as ready for review October 14, 2026 14:49

This branch has not been deployed

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant