Firefox bug with Selenium - Can't access dead object

心已入冬 提交于 2019-12-08 15:27:23

问题


I've tried to run my tests with Selenium 2 and Firefox 19. One of this tests causes an error "ERROR: Command execution failure. The error message is: can't access dead object".

I'm reading about it, it seems like a bug in newest Firefox's versions. Lot of people have the same issue, but I've not found anything really clear.

Any heroe can help us? Maybe we just need to change something in "about:config"?

Regards


回答1:


I was desperate about the same Problem and didn't find any solution although many people seemed to have the same problem.

I solved it by calling

webDriver.switchTo().defaultContent();

before calling any findElement method (using Java)




回答2:


This error generally comes when you do no switch back from frame and trying to access web elements directly. Use driver.switchTo().defaultContent(); and then try to access the elements




回答3:


I finally made a "cheat" to the browser.

I got the fail when Selenium clicked on a link and try to open the new page. What I've made is just simulate the click, doing a selenium.open("URL") which replace selenium.click("link=ButtonWhichOpenTheURL").

It seems to work by the moment




回答4:


I am facing the same error on Firefox 23 while reopening a pop up browser window. The only workaround I did is closing the current selenium session and relaunching it again. It worked fine for me.



来源:https://stackoverflow.com/questions/16396767/firefox-bug-with-selenium-cant-access-dead-object

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!