0

getting the error of timeout, tried to increase the time to 20, I see the page loading but still get the error and cannot see the email inserted to the field.

Code trials:

element = WebDriverWait(driver, 10).until(
    EC.presence_of_element_located((By.CLASS_NAME, 'input]'))
)
driver.find_element(By.XPATH, '//input[@class=input]').send_keys('test@em.com')

What is the problem?

undetected Selenium
  • 151,581
  • 34
  • 225
  • 281

2 Answers2

0

Try this

element = WebDriverWait(driver, 10).until(
    EC.presence_of_element_located((By.CLASS_NAME, 'input]'))

element.sendKeys('test@em.com')

or

element = WebDriverWait(driver, 10).until(
    EC.visibility_of_element_located((By.CLASS_NAME, 'input]'))

element.sendKeys('test@em.com')
Akzy
  • 579
  • 2
  • 12
0

To send a character sequence to the element instead of presence_of_element_located() you need to induce WebDriverWait for the element_to_be_clickable() and you can use the following locator strategy:

  • Using XPATH:

    WebDriverWait(driver, 20).until(EC.element_to_be_clickable((By.XPATH, '//input[@class="input"]'))).send_keys("test@em.com")
    
  • Note: You have to add the following imports :

    from selenium.webdriver.support.ui import WebDriverWait
    from selenium.webdriver.common.by import By
    from selenium.webdriver.support import expected_conditions as EC
    
undetected Selenium
  • 151,581
  • 34
  • 225
  • 281