Skip to content

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

Open
Dor-bl wants to merge 1 commit into
appium:masterfrom
Dor-bl:mirror/test-locator-converter-driver
Open

Dor-bl wants to merge 1 commit into
appium:masterfrom
Dor-bl:mirror/test-locator-converter-driver

Conversation

@Dor-bl

@Dor-bl Dor-bl commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor

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

This adds one parametrized test in test/unit/webdriver/webdriver_test.py: it calls driver.find_element(by=..., value=...) and then element.find_element(...) and asserts the request body is exactly {'using': by, 'value': ...}. It fails if the locator_converter=AppiumLocatorConverter() wiring in webdriver.py is removed.

  • make unittest: all pass
  • ruff check, ruff format --check, mypy appium: clean

@linux-foundation-easycla

linux-foundation-easycla Bot commented Nov 8, 2026 •

Copy link
Copy Markdown

CLA Signed
The committers listed above are authorized under a signed CLA.

  • ✅ login: Dor-bl / name: Dor Blayzer (aaa6aa2)

Selenium's default LocatorConverter rewrites these strategies to
'css selector'. Assert at the driver level that the Appium WebDriver,
and child element lookups, keep them as-is, so removing the
AppiumLocatorConverter wiring is caught.
@Dor-bl
Dor-bl force-pushed the mirror/test-locator-converter-driver branch from 47aac1a to aaa6aa2 Compare November 8, 2026 21:48
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