Element not Visible exception in Selenium using C#

Element not Visible exception occurs in these cases

  • Page has not loaded fully so the element is not visible
  • Script is too fast without any waits
  • XPath or ID is wrong
  • SubMenu within the menu is not visible as it disappears before the menu is clicked

 

The above are some of the reasons in which Element not Visible exception occurs and it can be easily corrected by following some of the below ways

  • Load the page fully
  • Wait for the specific elements to load
  • Use of Implicit Wait for the elements
  • Verifying the XPath using Online XPath tester
  • Verifying whether the ID’s and other selenium attributes are correct
  • Use of Handles

You may also like...