如何在Firefox中使用webdriver禁用Reader View [英] How to disable Reader View in Firefox using webdriver

查看:203
本文介绍了如何在Firefox中使用webdriver禁用Reader View的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

每当我在Firefox中运行我的测试,在地址栏中弹出阅读器视图消息框。这个弹出窗口将元素从视图中隐藏起来,所以Webdriver会抛出ElementnotvisibleException。这个弹出窗口显示的是非英文语言的页面
我禁用了阅读器视图选项,这对我没有多大帮助。关于如何解决这个问题将不胜感激。



谢谢 解决方案




  @Before 
public void setUp()throws Exception {
FirefoxProfile firefoxProfile = new FirefoxProfile();
firefoxProfile.setPreference(reader.parse-on-load.enabled,false);
driver = new FirefoxDriver(firefoxProfile);
baseUrl =http://google.com;
driver.manage()。timeouts()。implicitlyWait(30,TimeUnit.SECONDS);
}




$ p $应该这样做。

Whenever I run my test in firefox, 'Reader View' message box pops up in the address bar. This pop up hides the element from view, so Webdriver is throwing "ElementnotvisibleException. This pop up is displayed for the pages in languages other than English. I disabled the reader view option. This does not help me much.Any thoughts on how to overcome this issue will be much appreciated.

Thanks

解决方案

Something like this:

@Before
public void setUp() throws Exception {
    FirefoxProfile firefoxProfile = new FirefoxProfile();
    firefoxProfile.setPreference("reader.parse-on-load.enabled",false);
    driver = new FirefoxDriver(firefoxProfile);
    baseUrl = "http://google.com";
    driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);
}

should do it.

这篇关于如何在Firefox中使用webdriver禁用Reader View的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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