75年生人,程序员,在西安。

在Windows下使用FirefoxDriver的怪问题

用FirefoxDriver写了个测试网页的程序,在Linux下运行正常,但在Windows下运行出错,报:
Exception in thread "main" org.openqa.selenium.UnsupportedCommandException: Bad request
搞了大半天,用了各种方式尝试解决,都没搞定,终于google找到了网上的一个文章关于这个的:https://seleniumforum.forumotion.net/t717-trouble-with-creating-an-firefoxdriver-object

居然通过修改C:\WINDOWS\system32\drivers\etc\HOSTS 文件,在其中添加上这句:

127.0.0.1 localhost

就好了,不知其所以然啊~~~

评论(2)

© 世风十三 | Powered by LOFTER