Skip to content

test: verify driver sends By.ID/NAME/CLASS_NAME locators unconverted - #31

Draft
Dor-bl wants to merge 1 commit into
masterfrom
claude/pr-mirroring-decision-qxz8p4
Draft

Dor-bl wants to merge 1 commit into
masterfrom
claude/pr-mirroring-decision-qxz8p4

Conversation

@Dor-bl

@Dor-bl Dor-bl commented Oct 12, 2026

Copy link
Copy Markdown
Owner

Selenium's default LocatorConverter rewrites id, name and class name into css selector (e.g. [id="foo"]), which Appium native contexts don't support. AppiumLocatorConverter exists to prevent that, but no unit test checked the request body the driver actually sends for these strategies.

This adds one parametrized test in test/unit/webdriver/webdriver_test.py that calls driver.find_element(by=..., value=...) and then element.find_element(...), and asserts the request body is exactly {'using': by, 'value': ...}.

It's a driver-level alternative to #28. Unlike #28, it also fails if the locator_converter=AppiumLocatorConverter() wiring in webdriver.py is removed.

Verification

  • python -m pytest test/unit: 201 passed
  • With locator_converter=AppiumLocatorConverter() commented out in appium/webdriver/webdriver.py, the new test fails, as expected
  • ruff check / ruff format --check pass

🤖 Generated with Claude Code

https://claude.ai/code/session_012HCUdSWNJMojXCjBoxhg41


Generated by Claude Code

Selenium's default LocatorConverter rewrites these strategies to
'css selector'. Assert at the driver level that AppiumWebDriver (and
child element lookups) keep them as-is, so removing the
AppiumLocatorConverter wiring is caught.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012HCUdSWNJMojXCjBoxhg41
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.

2 participants