与最新版本的硒和Firefox不好的请求问题 [英] Bad request issue with latest version of selenium and firefox

查看:149
本文介绍了与最新版本的硒和Firefox不好的请求问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用phpunit-selenium来实现无头Firefox浏览器的自动化。我更新了硒和Firefox到最新版本。并且它开始为我抛出错误。

 PHPUnit_Extensions_Selenium2TestCase_WebDriverException:错误的请求

现在我为此搜索了一下,发现这个问题与hosts文件有关:

无法调用FirefoxDriver构造函数



https://code.google.com/p/selenium/issues/详细信息?id = 3280



但由于应用程序限制,我无法更新主机文件。有其他的方法来解决这个问题吗?

解决方案

修改个人资料应该可以解决您的问题。

请注意,这是一个Java代码片段,你将不得不做类似的PHP API:

$ p $ profile.setPreference(FirefoxProfile .ALLOWED_HOSTS_PREFERENCE, set.myhost.com);


I am working on phpunit-selenium for browser automation with headless Firefox. I updated both selenium and Firefox to latest version. And it started throwing error for me.

"PHPUnit_Extensions_Selenium2TestCase_WebDriverException: Bad request"

Now I googled for this and found that this issue is related to hosts files:

Unable to call FirefoxDriver constructor

https://code.google.com/p/selenium/issues/detail?id=3280

But I cannot update hosts file due to application restrictions. Is there another way to fix this?

解决方案

Modifying the profile should resolve the issue for you.

Note that this is a Java code fragment, You would have to do something similar with the php API:

   profile.setPreference(FirefoxProfile.ALLOWED_HOSTS_PREFERENCE,"set.myhost.com");

这篇关于与最新版本的硒和Firefox不好的请求问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆