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:
parent
5fad644ecc
commit
eba3553ec0
|
@ -42,8 +42,8 @@ public class ZkFixture extends SpiderFixture {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean withSelect(String locator, final boolean select) {
|
public boolean withSelect(final String locator, final boolean select) {
|
||||||
Widget widget = new Widget(locator);
|
final Widget widget = new Widget(locator);
|
||||||
final WebElement element = widget.$n(webDriver, "real");
|
final WebElement element = widget.$n(webDriver, "real");
|
||||||
if (element.isSelected()) {
|
if (element.isSelected()) {
|
||||||
if (!select) {
|
if (!select) {
|
||||||
|
@ -58,7 +58,9 @@ public class ZkFixture extends SpiderFixture {
|
||||||
ensureBecomes(new PollForWithError() {
|
ensureBecomes(new PollForWithError() {
|
||||||
@Override
|
@Override
|
||||||
public boolean matches() {
|
public boolean matches() {
|
||||||
return element.isSelected() == select;
|
//search again to avoid StaleElementReferenceException
|
||||||
|
final WebElement e = widget.$n(webDriver, "real");
|
||||||
|
return e.isSelected() == select;
|
||||||
}
|
}
|
||||||
@Override
|
@Override
|
||||||
public String error() {
|
public String error() {
|
||||||
|
|
Loading…
Reference in New Issue