New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
browser.navigate().back(); is causing "document unloaded while waiting for result" error #2600
Comments
If you can get this in a more isolated/reproducible state let's resubmit it as an issue and work on a fix. I'll try to reproduce this as well. Typically this happens when moving from a synchronized angular state to a non-synchronized one. That said, I think this is best suited for SO or gitter. Please ask a question there with the 'protractor' tag or post in the Gitter Channel to get help. |
Thanks @NickTomlin! but I had isolated that the issues here is that method in particular, since I had removed that step (the navigate back) and the expect function works, I had placed a browser.sleep(5000) right after the navigate.back() and that's how I found that it's trying to execute the next "expecs" on an "empty page". Thanks for the fast reply! Bruno |
I'm pretty sure the issue is actually just that |
@sjelin I've tried what you told and it does not work, in fact, the clicking action does happens and finishes when it should since I'm seeing the action being done while the test runs... so, I think that the problem here is the Can you please give me a hint to where can I look at to solve this? Thanks a lot. Bruno |
@sjelin @NickTomlin I've just checked using it against Firefox, and the @sjelin's suggestion works! so, the problem is with Chrome! are you aware of any issues around with this with browser? Is there any workaround that you my suggest? Thanks!! |
I still think it's a that the click is in some part pending when the navigation happens - that's what the error message says after all. Try: it('Verify user sees the home page correctly when hitting back button', function () {
browser.get('/flight/los-angeles/');
expect(testUtils.getTextFromField(topSearchBarPage.airportDestLocator)).toContain("LAX");
element.all(by.css(".day-droppable.ui-droppable")).get(30).click();
element(by.css(".btn-primary")).click();
browser.waitForAngular().then(function() {
browser.navigate().back();
expect(browser.getTitle()).toMatch('page title');
expect(browser.getCurrentUrl()).toContain("/flight/los-angeles/");
});
}); |
Actually, we're facing pretty much the same behavior of The code causing error is:
or
Reproducible on Firefox versions: 43.0.1, node v4.4.3, Protractor 4.0.9
Stick to that temporary solution by now. |
Hello,
I've read all the questions/answers on the platforms, and none of them helped me to solve my issues, the thing is that I have the following test script:
And then I'm getting this error:
I can see (because I've placed an sleep) that right after executing the
navigate.back()
the test tries to reload the page, and when it tries to execute the expects, it throws the error.This is how the app looks like after the navigate.
Please help!
Thanks
The text was updated successfully, but these errors were encountered: