-
Notifications
You must be signed in to change notification settings - Fork 5.1k
Closed
Description
Page(s)
https://playwright.dev/python/docs/api/class-locator#locator-and
Description
Issue Description
In the documentation file docs/src/api/class-locator.md, the Python code examples for the Locator.and method use an incorrect camelCase method name getByTitle instead of the correct snake_case get_by_title.
Current Code (Incorrect)
# Python async
button = page.get_by_role("button").and_(page.getByTitle("Subscribe"))
# Python sync
button = page.get_by_role("button").and_(page.getByTitle("Subscribe"))Expected Code (Correct)
# Python async
button = page.get_by_role("button").and_(page.get_by_title("Subscribe"))
# Python sync
button = page.get_by_role("button").and_(page.get_by_title("Subscribe"))Location
- File:
docs/src/api/class-locator.md - Lines: 136, 140
- Section:
Locator.andmethod examples
Impact
This causes confusion for Python developers following the documentation, as getByTitle is not a valid method in the Playwright Python API. The correct method name should follow Python's snake_case convention: get_by_title.
Solution
Change getByTitle to get_by_title in both Python async and sync code examples to match the actual Playwright Python API.
Additional Context
I have already prepared a fix for this issue and am ready to submit a pull request once this issue is created.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels