select_by_text
The command to select an <option> by its text within a <select> dropdown element.
Syntax
Element.select_by_text(text: str) -> ElementUsage
py.get("#dropdown").select_by_text("Option 1")
---or--- # chain an Element command
py.get("#dropdown").select_by_text("Option 2").get_attribute("value")# Errors, can only perform this command on a <select> dropdown element
py.get("ul > li").select_by_text("Option 3")Arguments
Yields
Examples
See also
Last updated