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.
Provide documentation on how to use correctly browser.wait with protractor.ExpectedConditions #3578
Open
Description
I'm trying to use the protractor.ExpectedConditions together with browser.wait() but i'm sporadically failing with the error: stale element reference: element is not attached to the page document.
The way i'm using the function is the following:
function (locator, timeout) {
var t = timeout === undefined ? exports.browserTimeout() : timeout;
var EC = protractor.ExpectedConditions;
browser.wait(EC.invisibilityOf(element(locator)), t);
};
the reason that is causing the failure is probably that between the call to element(locator) and the usage of the element i've applications refresh that remove the element and cause the issue when the refernece is used.
i've not found any good documentation to use this routines without having this issue.
could you please provide some guidelines?