Java webdriver: Element not visible exception

前端 未结 5 833
一向
一向 2020-12-11 05:31

I\'m having the following problem. I have a dropdown that is hidden so when I make the Select and run the test i get the following error:

 org.openqa.seleniu         


        
5条回答
  •  情书的邮戳
    2020-12-11 06:29

    In addition to the reasons and issues raised by the earlier answers, I encountered another cause worth mentioning. In my case, a JavaScript on the page had to run after clicking a link on the page in order for the elements that I wanted to access to become visible. That's ok as long as your driver has JavaScript enabled. In my case, I was running without JavaScript, so even though the link was "clicked" programmatically, the elements were not becoming visible. I was using HtmlUnitDriver with the default settings. Ultimately I switched to ChromeDriver. (You can enable JavaScript on HtmlUnitDriver, but that - for other reasons - was not enough for me in my case.)

提交回复
热议问题