Clears the text if it's a text entry element. Example: text_field = driver.find_element(By.NAME, "username") text_field.clear()
(self)
| 141 | raise WebDriverException("To submit an element, it must be nested inside a form element") from exc |
| 142 | |
| 143 | def clear(self) -> None: |
| 144 | """Clears the text if it's a text entry element. |
| 145 | |
| 146 | Example: |
| 147 | text_field = driver.find_element(By.NAME, "username") |
| 148 | text_field.clear() |
| 149 | """ |
| 150 | self._execute(Command.CLEAR_ELEMENT) |
| 151 | |
| 152 | def get_property(self, name: str) -> str | bool | WebElement | dict: |
| 153 | """Gets the given property of the element. |