Skip to content
This repository was archived by the owner on Jul 29, 2024. It is now read-only.
This repository was archived by the owner on Jul 29, 2024. It is now read-only.

"Detected page unload event" after window.location.reload() [FireFox bug] #3713

Closed
@latobibor

Description

@latobibor

Hi,

In our angular 1.5.5 app we are using window.location.reload() to reload the page at a certain operation that unfortunately needs it. However, while we are running the tests we have issues with on FireFox which throws "Detected page unload event" exception when the next element is requested. We don't see it happening on Chrome.

  • Node Version: 7.0.0
  • Protractor Version: 4.0.10
  • Angular Version: 1.5.5
  • Browser(s): FireFox v46
  • Operating System and Version Windows 10
  • geckodriver: 0.9.0
  • selenium: 2.53.1

A seemingly relevant line from the exception:
From: Task: Protractor.waitForAngular() - Locator: By(css selector, .form-signin-heading)

How we reload our site in the production code (simplified version):

$window.location.reload();

The command that failed (after the reload):

browser.wait(EC.visibilityOf(/* our element */), 10000);

We managed to make a workaround of the issue with this hack:

const capabilities = await browser.driver.getCapabilities();
if (capabilities.get('browserName') === 'firefox') {
  log.step('We have to refresh firefox because language change triggers an "external" reload');
  await browser.refresh();
}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions