Element not interactable exception

Hello, I am very new to this and would appreciate some help here. I am trying to log in to Google Alerts and download the alerts generated. I am successfully able to click on the sign in button. Thereafter I enter my mail id. I then press the return key. I am then trying to enter the password using Input Text xpath://input[@type = "password"] 1234. This is where I get a ElementNotInteractableException: Message: element not interactable error. To ensure that the element is being displayed, I did a Click Element If Visible xpath://input[@type = "password"] before this and it works. How do I overcome this error?

Hi, @dhirajkhanna!

If I understood correctly, you are trying to enter credentials for the Google login? If so, this should work:

*** Settings ***
Documentation     Google Alerts robot.
Library           RPA.Browser

*** Tasks ***
Log in to Google Alerts
    Open Available Browser    https://www.google.com/alerts
    Click Link    Sign in
    Input Text When Element Is Visible    name:identifier    you@youremail.com
    Click Button    Next
    Wait Until Element Is Visible    name:password
    Input Password    name:password    yourpassword
    Click Button    Next

If you get that working, the next thing to do is to move your credentials out of the .robot file and store them somewhere safe (do not commit your credentials in your repository!). You can refer to https://robocorp.com/docs/examples/web-store-order-robot for a practical example.

2 Likes

@jani thank you so much! Works like a charm! I will go through the link you have shared. Currently I am storing my emailid and password in variables.py and using ${PASSWORD} to fill in the relevant text inputs.

Now moving on to extracting the alerts and saving them in a csv file. I supose that is doable, right? My end goal is to save the alerts and use python’s spaCy package for some named entity recognition. Could I source the python script in the bot itself?

Great that you were able to proceed!

Yes, it sounds like your Python entity recognition script could work nicely as a custom library. The web store order robot also happens to have a simple example of creating your own Python library to do anything you want. The methods from that library are then exposed as keywords for the robot by Robot Framework.

If you get stuck with your robot, we are happy to help!

1 Like