Monday, June 9, 2014

Protractor: How to select a dropdown option to avoid ElementNotVisibleError

Another problem we found last week using protractor was when we tried to click on a dropdown option.

This was the problematic code:


which caused the following error:
ElementNotVisibleError: element not visible

This happened because the element we were trying to click on was hidden.

Googling a bit again, we found (here) that to avoid the error we had to click on the dropdown before clicking on the option to open it up, so that it wa visible to the user:


Again we extracted this bit of code into a helper method in out TestTools module:


----------------

PS: Check also my previous post about Protractor:

No comments:

Post a Comment