-1

I am running a code in Python that is to open a Google Doc and type in a certain set of combinations for a set length. I have the code that allows me to go to my Google Docs and open up a new document, however when I try to find the XPATH or element to type in text into the doc itself, I keep getting an error that says:

selenium.common.exceptions.ElementNotInteractableException: Message: element not interactable

Currently, I keep trying to see if the XPATH is //*[@id="kix-appview"]/div[7]/div/div[1]/div[1]/div/div/div/div[2]/div/div[2]/div[1]/div/div/div[1]/div/div/div/div/div/span[2]/span/span could be shorter but I don't care about how large the file size is. If anyone is able to help out or happens to know the XPATH off the top of your head, all help would be appreciated.

Michael Pate
  • 89
  • 1
  • 9

1 Answers1

0
Try below xpath :

wait = WebDriverWait(driver, 30)
wait.until(EC.element_to_be_clickable((By.XPATH, "//*[@id='kix-appview']/div[7]/div/div[1]/div[1]/div/div/div/div[2]/div/div[2]/div[1]/div/div/div[1]/div/div/div/div/div/span[2]/span/span")))

Note : please add below imports to your solution

from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
SeleniumUser
  • 4,065
  • 2
  • 7
  • 30
  • I keep getting the same error. I am trying to type in text into the document, but every time my code gets to the point where I am to type in text into the document, I get the same error as above. – Michael Pate Apr 15 '20 at 16:33
  • share you link if possible – SeleniumUser Apr 15 '20 at 16:34
  • if you are facing error ImportError: No module named selenium then refer https://stackoverflow.com/questions/31147660/importerror-no-module-named-selenium – SeleniumUser Apr 15 '20 at 17:19
  • I am not having an import error. I used codepad to show my code since I am running my code using Geany. I am not using Github to store my code or anything like that, I just am using Geany to run my code and to store it as a .py file. My error when I run the code using Geany is element not interactable. – Michael Pate Apr 15 '20 at 17:30
  • So if i want to check your element on your site :: //*[@id='kix-appview']/div[7]/div/div[1]/div[1]/div/div/div/div[2]/div/div[2]/div[1]/div/div/div[1]/div/div/div/div/div/span[2]/span/span – SeleniumUser Apr 15 '20 at 17:32
  • The element is on this website if that is what you are asking.https://docs.google.com/document/d/1UFZbhyiE9H7AFdYH7M9D73wCdt89I83Yxb2qAsoUHx4/edit?usp=sharing – Michael Pate Apr 15 '20 at 18:21
  • Are you trying to handle arrow key please hightligh your element in the screenshot – SeleniumUser Apr 15 '20 at 18:40