标题和Selenium Webdriver 2

编程入门 行业动态 更新时间:2024-10-10 09:18:51
本文介绍了标题和Selenium Webdriver 2的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 有什么办法在Selenium WebDriver测试中添加头文件? (与Firefox修改头文件插件一样)我无法使用HtmlUnitDriver,因为浏览器必须可见。 WebDriver不允许您使用任何基于浏览器的驱动程序更改或设置标头。您可以在以下URL中找到许多有关他们对标题和响应代码的决定的信息。 code.google/p/selenium / issues / detail?id = 141

我们使用Apache HTTP Client进行这种类型的测试,我们不想检查呈现的页面元素,但只是响应和标题信息。

您也可以使用您的硒测试以及上面的url中提到的浏览器暴徒代理。我已经将其用于其他目的,并且非常棒。

Is there any way to add a header in Selenium WebDriver test? (Like with Firefox Modify Headers plugin) I cannot use HtmlUnitDriver, because the browser has to be visible.

解决方案

WebDriver does not allow you to change or set the headers using any of the browser based drivers. You can find a lot of information about their decision about the headers and the response codes at the following URL. code.google/p/selenium/issues/detail?id=141

We use Apache HTTP Client for this type of testing where we do not want to check the rendered page elements, but just the responses and header information.

You can also give browser mob proxy with your selenium tests as well as mentioned in the url above. I have used this for other purposes and it is awesome.

更多推荐

标题和Selenium Webdriver 2

本文发布于:2023-11-27 16:23:49,感谢您对本站的认可!
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:标题   Selenium   Webdriver

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!