Skip to content

Python: Inconsistent find_element(s)_by_* deprecation warning and command documentation #8806

@bonafideduck

Description

@bonafideduck

🐛 Bug Report

In the python remote/webdriver.py code, find_element_by_id() and many similar commands have this warning:

warnings.warn("find_element_by_* commands are deprecated. Please use find_element() instead")

find_element() and find_elements() have this contradicting documentation comment:

    """
    Find an element given a By strategy and locator. Prefer the find_element_by_* methods when
    possible.
    """

To Reproduce

Look at the code links above.

Expected behavior

Personally, I don't see why the find_element(s)_by_* commands have been deprecated. So I didn't expect to see that warning. If someone has a pointer to a conversation that lead to this decision, I'd like to see it.

At a minimum, I'd like the documentation and code be consistent.

Test script or set of commands reproducing this issue

NA

Environment

github source

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-needs-triagingA Selenium member will evaluate this soon!

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions