Skip to content

[πŸ› Bug]: element.get_dom_attribute("checked") for a checked checkbox element is not returning TrueΒ #14800

@mdmintz

Description

@mdmintz

What happened?

element.get_dom_attribute("checked") for a checked checkbox element is not returning True

In 4.27.0, element.get_attribute() was deprecated in favor of element.get_dom_attribute(). However, the new method does not get the correct results, as in the following example where I was determining whether or not a checkbox was checked:

(Pdb+) element.tag_name
'input'
(Pdb+) attribute
'checked'
(Pdb+) element.get_attribute(attribute)
'true'
(Pdb+) element.get_dom_attribute(attribute)
(Pdb+) element.get_dom_attribute(attribute)
(Pdb+)

How can we reproduce the issue?

Call `element.get_dom_attribute(attribute)` for an `input` element of `type="checkbox"`, where the checkbox is checked.

There's no output.

The deprecated method, `element.get_attribute(attribute)`, correctly returns `true`.

Relevant log output

(Pdb+) element.tag_name
'input'
(Pdb+) attribute
'checked'
(Pdb+) element.get_attribute(attribute)
'true'
(Pdb+) element.get_dom_attribute(attribute)
(Pdb+) element.get_dom_attribute(attribute)
(Pdb+)

Operating System

Any

Selenium version

Python - 4.27.0

What are the browser(s) and version(s) where you see this issue?

Chrome

What are the browser driver(s) and version(s) where you see this issue?

Latest

Are you using Selenium Grid?

No

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-needs-triagingA Selenium member will evaluate this soon!I-defectSomething is not working as intended

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions