#18084·selenium

Publish a machine-readable API reference for all bindings

Author: AutomatedTesterCreated Sep 28, 2026Updated Sep 28, 2026

Background

#17906 makes the Python API reference machine-readable and ships guidance inside the wheel. Requested by @diemol on that PR, this issue tracks doing the same across the other bindings — it makes sense to implement across languages.

The problem: LLM training data for Selenium is dominated by Selenium 2/3-era material, so coding agents reliably emit removed APIs — DesiredCapabilities, executable_path, third-party driver managers, a sleep where a wait belongs. Users then attribute that code to Selenium. Publishing current, machine-readable references at stable URLs gives retrieval-based tools something correct to find, and declaring a canonical URL stops unofficial mirrors outranking us.

No ADR needed for this — settled in #17906.

What Python shipped

Four artefacts at stable URLs under /selenium/docs/api/py/:

File What it is Source
llms.txt Index of the API reference plus versioned anti-pattern rules py/docs/source/_ext/llm_assets.py
sitemap.xml Every API page, for crawlers same extension
objects.inv Sphinx object inventory — already emitted, now documented rather than discarded Sphinx
deprecations.json 16 deprecated APIs, each mapped to its replacement, parsed out of the warnings.warn messages py/generate_deprecations.py

Plus two things that aren't files:

  • Canonical URL. html_baseurl puts rel=canonical on every page pointing at the released reference on selenium.dev, so the Read the Docs preview and third-party mirrors stop competing with it for recall.
  • In-package guidance. selenium/llms.txt ships inside the wheel, so a tool with the package on disk finds the project's own guidance instead of inferring it. The published llms.txt reads its rules back out of that same file, so there is one copy rather than two to drift apart.

The guidance rules are deliberately versioned — each says which release the old form stopped being correct in (executable_path 4.10, find_element_by_* 4.3, options.headless 4.9) — because a reader that has absorbed a decade of blog posts needs the version to know which memory to discard.

Per-binding work

Each binding's doc toolchain differs (javadoc, docfx, yard, jsdoc), so this can't be one shared implementation. The output contract should match, though — same filenames, same URL shape, same deprecations.json schema.

  • Java — javadoc
  • .NET — docfx
  • Ruby — yard
  • JavaScript — jsdoc

For each of the four:

  • llms.txt at /selenium/docs/api/<lang>/llms.txt
  • sitemap.xml
  • deprecations.json, same schema as Python's
  • rel=canonical on every generated page
  • guidance file shipped inside the published artefact — jar, nupkg, gem, npm package

Cross-binding work

Needs all five bindings done first:

  • Merge the per-binding deprecations.json files into one cross-binding dataset
  • /selenium/docs/api/llms.txt indexing all five references
  • A real landing page at /selenium/docs/api/ — there isn't one today

Work in SeleniumHQ/seleniumhq.github.io

  • Link the API reference artefacts from the site's llms.txt
  • Add a Sitemap: line for /selenium/docs/api/ to the site's robots.txt. The API docs are served from this repo's gh-pages branch under the same host as the site, so the site's robots.txt is the only place that sitemap can be advertised.
  • Reconcile the anti-pattern guidance, which now exists in three places: the site's index.llms.txt, the new AI agents documentation page, and each binding's in-package llms.txt. The per-binding copies need binding-specific syntax and version numbers, so full deduplication isn't the goal — but there is no mechanism keeping them consistent today.

Known constraint

API docs only regenerate at release, so all of this is invisible for a full release cycle until nightly publishing exists. Worth knowing before anyone tries to verify a change by fetching the published URL.