Selenium Xpath Script Failure: Element is not currently interactable and may not be manipulated

Let’s take an example to understand when selenium scripts throws below error.

Element is not currently interactable and may not be manipulated

Scenario: You are trying to record a login form which loads onto the page dynamically and final login view is in the modal rather than a page. The module takes time to load due to content or could be network issue at a particular time. However, selenium is trying to find recorded elements to fill the fields.

Put selenium wait functions if login form takes time to load so that selenium wait for the DOM to load before execute next statement.

Root cause of above error

The root cause of the issue is that selenium finds many fields with same id, class or whatever field you are trying to find in the login form. Check if your base page and model popup has similar input field. If you do find duplicate fields then try to put additional hierarchy to find appropriate DOM field. Take below example.

#XPATH Query to find specific input field based on above div class name.
//div[@class='registration-body']//input[contains(@class, 'email-input')]

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.