IDEMPIERE-92 Implement Selenium testing framework. Fixed "org.openqa.selenium.remote.ErrorHandler$UnknownServerException: Element is no longer attached to the DOM"

This commit is contained in:
Heng Sin Low 2013-04-26 16:27:27 +08:00
parent 5fad644ecc
commit eba3553ec0
1 changed files with 5 additions and 3 deletions

View File

@ -42,8 +42,8 @@ public class ZkFixture extends SpiderFixture {
}
@Override
public boolean withSelect(String locator, final boolean select) {
Widget widget = new Widget(locator);
public boolean withSelect(final String locator, final boolean select) {
final Widget widget = new Widget(locator);
final WebElement element = widget.$n(webDriver, "real");
if (element.isSelected()) {
if (!select) {
@ -58,7 +58,9 @@ public class ZkFixture extends SpiderFixture {
ensureBecomes(new PollForWithError() {
@Override
public boolean matches() {
return element.isSelected() == select;
//search again to avoid StaleElementReferenceException
final WebElement e = widget.$n(webDriver, "real");
return e.isSelected() == select;
}
@Override
public String error() {