Add AI agents documentation page - #2846
Conversation
✅ Deploy Preview for selenium-dev ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
diemol
left a comment
There was a problem hiding this comment.
Shouldn't this be a blog post? Maybe I don't see it the same way.
|
Fair question, and I went back and forth on it. The main argument for docs is that the whole point of this page is to be found by an agent reading our documentation. The other pull is maintenance. This is probably the most time-sensitive content on the site, because the specific things models get wrong will shift as they improve. Docs get reviewed, translated and updated as part of the normal process. A post dated 2026 stays frozen and keeps ranking. And a fair amount of the page is really just routing — waits, Selenium Manager, locators, BiDi, the upgrade guide. It is mostly a navigation layer over things we already document, which feels like a docs job. That said, I don't think it has to be either/or, and the blog is much better at attention than the docs are. Happy to write a post announcing it and pointing at the page — blog for reach, docs for durability. Want me to do that as a follow-up? |
|
Also, I got the idea from wdio, they are adding this as a separate page. |
Adds a documentation page on getting coding agents and LLMs to write current, correct Selenium code. LLM training data for browser automation is dominated by Selenium 2 and 3 era material, so agents reliably emit removed APIs and patterns that were never good practice. The page gives readers three things: where to point an agent for current documentation, a paste-ready rules block for AGENTS.md/CLAUDE.md with per-binding tabs, and the reasoning behind each rule so bad output is recognisable in review. Covers driver management vs Selenium Manager, Options vs DesiredCapabilities, explicit waits vs sleeping, locator durability, BiDi vs CDP, and Grid 4 vs Grid 3 invocations. Also covers letting an agent drive a real browser to verify locators, and pointing it at the common errors and logging pages when a test fails. Sits in the sidebar between IDE and Test Practices. Co-Authored-By: Copse <noreply@copse.dev> Copse-Models: acp:claude-agent-acp#opus[1m]
The site already renders a curated llms.txt from layouts/index.llms.txt, which is exactly the entry point this page should hand to an agent. Adds it as the first row of the documentation table, explains that it is curated rather than exhaustive, and notes why the legacy and CDP pages are deliberately kept out of the main index. Also adds it to the sample rules block, along with a rule against using the legacy and CDP pages as a basis for new code. The page needed no change to the llms.txt template: its curated index picks up new pages under /documentation automatically, and the drift check reports nothing. Co-Authored-By: Copse <noreply@copse.dev> Copse-Models: acp:claude-agent-acp#opus[1m]
a51ae7b to
68d5b3c
Compare
* Add AI agents documentation page Adds a documentation page on getting coding agents and LLMs to write current, correct Selenium code. LLM training data for browser automation is dominated by Selenium 2 and 3 era material, so agents reliably emit removed APIs and patterns that were never good practice. The page gives readers three things: where to point an agent for current documentation, a paste-ready rules block for AGENTS.md/CLAUDE.md with per-binding tabs, and the reasoning behind each rule so bad output is recognisable in review. Covers driver management vs Selenium Manager, Options vs DesiredCapabilities, explicit waits vs sleeping, locator durability, BiDi vs CDP, and Grid 4 vs Grid 3 invocations. Also covers letting an agent drive a real browser to verify locators, and pointing it at the common errors and logging pages when a test fails. Sits in the sidebar between IDE and Test Practices. Co-Authored-By: Copse <noreply@copse.dev> Copse-Models: acp:claude-agent-acp#opus[1m] * Link llms.txt from the AI agents page The site already renders a curated llms.txt from layouts/index.llms.txt, which is exactly the entry point this page should hand to an agent. Adds it as the first row of the documentation table, explains that it is curated rather than exhaustive, and notes why the legacy and CDP pages are deliberately kept out of the main index. Also adds it to the sample rules block, along with a rule against using the legacy and CDP pages as a basis for new code. The page needed no change to the llms.txt template: its curated index picks up new pages under /documentation automatically, and the drift check reports nothing. Co-Authored-By: Copse <noreply@copse.dev> Copse-Models: acp:claude-agent-acp#opus[1m] --------- Co-authored-by: Copse <noreply@copse.dev> [deploy site] 51b6d28
Announces the new AI agents documentation page added in #2846. The post takes the angle that agents are not hallucinating when they emit Selenium 3 code - they were taught by a decade of blog posts and tutorials, a good share of which this community wrote, and which still outnumber everything published since. From there it pulls out the three things worth acting on: point the agent at llms.txt, write the project rules into AGENTS.md/CLAUDE.md, and let it drive a real browser so locators are verified rather than inferred. Singles out one pattern for review: agents "fixing" a flaky test by raising a timeout or adding a sleep, which hides the race instead of removing it. Links to the documentation page rather than restating it, so the post stays short and the docs remain the reference. Copse-Models: acp:claude-agent-acp#opus[1m] Co-authored-by: Copse <noreply@copse.dev> [deploy site]
Announces the new AI agents documentation page added in #2846. The post takes the angle that agents are not hallucinating when they emit Selenium 3 code - they were taught by a decade of blog posts and tutorials, a good share of which this community wrote, and which still outnumber everything published since. From there it pulls out the three things worth acting on: point the agent at llms.txt, write the project rules into AGENTS.md/CLAUDE.md, and let it drive a real browser so locators are verified rather than inferred. Singles out one pattern for review: agents "fixing" a flaky test by raising a timeout or adding a sleep, which hides the race instead of removing it. Links to the documentation page rather than restating it, so the post stays short and the docs remain the reference. Copse-Models: acp:claude-agent-acp#opus[1m] Co-authored-by: Copse <noreply@copse.dev> [deploy site] 94c7cbd
Description
Adds a new documentation page, Documentation → AI Agents (
/documentation/ai_agents/), on getting AI coding agents and LLMs to write Selenium code that is current, correct, and not flaky. It sits in the sidebar between IDE and Test Practices (weight 11).The page is structured as:
llms.txtfirst, then this site, theexamples/directory, the per-binding API docs, and the changelogs, with the instruction that matters most: if an API isn't in the current docs, it doesn't exist.AGENTS.md/CLAUDE.md/ rules files, followed by a tabpane of the binding-specific removals models get wrong most often (JavaDurationandfindElementBy*, Pythonfind_element_by_*/executable_path/desired_capabilities, C#AddAdditionalCapability, Rubywebdrivers, JavaScript unawaited promises, Kotlin).DesiredCapabilities, explicit waits vs sleeping (including the second-order failure where an agent "fixes" a flaky test by raising a timeout), locator durability, BiDi vs CDP, and Grid 4 subcommands vs Grid 3-role hub.Motivation and Context
A large share of Selenium code is now written with an agent's help, and it is wrong in a consistent, predictable set of ways. The cause is the training data: models learned Selenium from more than a decade of blog posts, forum answers, and tutorials describing Selenium 2 and 3. Those APIs were removed years ago, and the most-repeated patterns in that material — sleeping to wait for the page, downloading driver binaries by hand, copying XPath out of DevTools — were never good practice even when they compiled.
We already document all of the correct answers, but they are spread across the upgrade guide, the waits page, Selenium Manager, locators, and BiDi. This page collects what an agent specifically gets wrong into one place, and gives users something they can paste into a rules file today.
On llms.txt
The second commit links
llms.txtas the first entry in the documentation table and adds it to the sample rules block, along with a rule against using the legacy and CDP pages as a basis for new code. The page explains that the index is curated rather than exhaustive, and why those two sets of pages are deliberately excluded from it.No change to
layouts/index.llms.txtwas needed: the curated index picks up new pages under/documentationautomatically, so the new page is already listed under "Getting started" in the generated output, and the template's drift check reports nothing.Notes for reviewers
A couple of judgment calls worth a second opinion:
4.49.0to matchexamples/. The per-binding removal claims are worth an eye — particularly Ruby's:desired_capabilitiesand Python'soptions.headless.Types of changes
Checklist
Verified locally with a full
hugo --minifybuild — clean, no warnings, every cross-reference resolves and the llms.txt drift check is silent — and visually inhugo server: the tabpane, the table, the cross-links, and the sidebar ordering all render correctly.