Protractor "stale element reference: element not attached... How do I fix this?
Date : March 29 2020, 07:55 AM
hop of those help? In protractor expect() is "patched" to resolve promises implicitly, you can just do: expect(browser.getCurrentUrl()).toEqual("http://SomeValueAlreadyKnown");
|
" stale element reference" error happening right after finding the element visible by "wait.until(Expecte
Tag : java , By : noboruwatanabe
Date : March 29 2020, 07:55 AM
hop of those help? Depending on what framework was used to build the web app, it is entirely possible the app is redrawn multiple times. Here is one example that I myself encountered. So what you are seeing in your case is: You are waiting for the element to be visible. Page is drawn, element is visible, your test moves on. After calculating additional components of the page, the page is refreshed. All elements from #2 become stale. Your test tries to manipulate an element from #2.
|
How to Handing sub-links --"stale element reference: element is not attached to the page document"
Date : March 29 2020, 07:55 AM
it should still fix some issue You get stale element when you search for an element and before doing any action on it the page has changed/reloaded. Make sure the page is fully loaded before doing any actions in the page. First wait for the page to be loaded -> then find the element and execute action.
xpa[i]="//table[@class='hideHeader']//span[@id='subMenu']//div[@id='i_2sub']//tbody/tr["+i+"]";
|
Getting Error "Stale element reference: element is not attached to the page document" in selenium -Java
Date : March 29 2020, 07:55 AM
I think the issue was by ths following , In case of staleelementexception the problem is generally due to the fact that a reference is requested to an element that has been updated or is new (even if maybe it has the same id) and therefore we have an invalid reference to it. It can be solved by asking for a clean reference of the item or adding a wait in the workflow You can try something like this: WebDriverWait wait = (WebDriverWait)new WebDriverWait(driver,timeout)
.ignoring(StaleElementReferenceException.class);
wait.until(new ExpectedCondition<Boolean>(){
@Override
public Boolean apply(WebDriver webDriver) {
WebElement element = webDriver.findElement(by);
return element != null && element.isDisplayed();
}
});
|
Protractor did not run properly when using browser.wait, msg: "Wait timed out after XXXms"
Date : March 29 2020, 07:55 AM
|