Hi,
I meet the following error when i try to mouseDown and mouseUp an drop-down list option on my app. The scenario is that, a pop-up iframe will pop-up after the option is selected. The actual result is that the option is selected but the following error was threw. In this case, i want to find a way to ignore the error and continue my script.
(node:1148) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejec
tion id: 1): StaleElementReferenceError: stale element reference: element is not
attached to the page document
I am using nodeJS and my script is something like following. And i try that i cannot select the option by using webelement.click() successfully, so i try to use ActionSequence.
var AcS = new webdriver.ActionSequence(driver);
driver.wait(until.elementLocated(By.css(optionCss)), 10 * globalWaitTime).then(function(){
driver.wait(until.elementIsVisible(driver.findElement(By.css(optionCss))), 10 * globalWaitTime).then(function(){
var elOption = driver.findElement(By.css(optionCss));
AcS.
mouseDown(elOption).
mouseMove(elOption).
mouseUp(elOption).
perform();
});
});