How To Select 'username' Field On Website With Selenium Webdriver?
All I'm trying to do is enter a username and password... I tried: username=driver.find_element(By.CSS_SELECTOR('UserId')) username.send_keys('test') but it gave me the error: user
Solution 1:
The method find_element
requires 2 arguments:
username=driver.find_element(By.NAME, "UserId")
username.send_keys("test")
You could also use find_element_by_name
username=driver.find_element_by_name("UserId")
username.send_keys("test")
Post a Comment for "How To Select 'username' Field On Website With Selenium Webdriver?"