user4884895
user4884895

Reputation: 149

How to disable Reader View in Firefox using webdriver

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

Upvotes: 2

Views: 3129

Answers (4)

ganeshnarayanan
ganeshnarayanan

Reputation: 1

It is simple thing you can tackle this kind of inconvenience. Just use refresh code for this script.

For Example: driver.navigate().refresh();

Upvotes: 0

DK1967
DK1967

Reputation: 23

I just encountered this same issue. The initial load of a Firefox browser showed the Reader View alert and the test couldn't see the page elements behind the alert. Although I turned off the Reader View on the Firefox about:config page, the raw FF browser that my test starts does not regard that setting.

My solution was simply to program a reload of the page. The subsequent page load doesn't show the Reader View alert and things work as I intended.

A bonus to this simple solution is that it will work for whomever runs the test - you won't need to require a Firefox admin tweak for all who run the test.

Upvotes: 0

Antonio Terreno
Antonio Terreno

Reputation: 3055

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.

Upvotes: 4

Ivan Litskevich
Ivan Litskevich

Reputation: 84

  1. Navigate to about: config
  2. To remove Reader view, change reader.parse-on-load.enabled preference value to ‘false‘.

Or just downgrade your Firefox. Mozilla enabled Reader view feature in Firefox 38.0.5

Upvotes: -2

Related Questions