-1

I'm facing an error trying to click on an element as follows:

raise exception_class(message, screen, stacktrace) selenium.common.exceptions.ElementNotInteractableException: Message: element not interactable (Session info: chrome=104.0.5112.80)`

Code trials:

driver.find_element(By.XPATH,"//input[@id='idSIButton9']").click()

Html:

enter image description here

undetected Selenium
  • 183,867
  • 41
  • 278
  • 352
Umme
  • 1
  • 2
  • Can you confirm the url, is it public facing? – Barry the Platipus Aug 10 '22 at 11:09
  • URL is not public – Umme Aug 10 '22 at 12:29
  • Let me share the URL : https://vollee-dev.azurewebsites.net/ – Umme Aug 10 '22 at 12:50
  • Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking. – Community Aug 10 '22 at 13:05
  • for the url : vollee-dev.azurewebsites.net , I am trying write python automation script to login. for this line of code (SignIn) : driver.find_element(By.XPATH,"//input[@id='idSIButton9']").click() I get the above error. – Umme Aug 10 '22 at 13:26
  • Ok, I see a login page there, 2 buttons - login & signup, and another alt-logins with Google/Ms. What are you trying to achieve there? Login? Signup? I see no element with `id = idSIButton9`. – Barry the Platipus Aug 10 '22 at 17:56
  • I am trying to login with alt-logins with Ms. After entering email and password I want to click on signin for which the xpath is id="idSIButton9" then i get the error – Umme Aug 11 '22 at 05:19

1 Answers1

-1

As per the HTML:

button

The element is a <button> tag not an <input> tag. So (By.XPATH,"//input[@id='idSIButton9']") may not work.


Solution

To click on the clickable element you need to induce WebDriverWait for the element_to_be_clickable() and you can use either of the following locator strategies:

  • Using CSS_SELECTOR:

    WebDriverWait(driver, 20).until(EC.element_to_be_clickable((By.CSS_SELECTOR, "button.button.bits[type='button']"))).click()
    
  • Using XPATH:

    WebDriverWait(driver, 20).until(EC.element_to_be_clickable((By.XPATH, "//button[@class='button bits' and text()='Buy Now']"))).click()
    
  • 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
  • 183,867
  • 41
  • 278
  • 352