4. Locating Elements with By.ID & send_keys

Locators in Python

from selenium.webdriver.common.by import By

pwd_el = driver.find_element(By.ID, "password")
pwd_el.send_keys("secret_sauce")

Task

  • Locate the element using `By.ID` and send the keys `"secret_sauce"`.
💡Common doubts
Did you like the problem?
Lesson 4 of 8
Python
Loading code editor…
Next