From d3d9079c437a704d12b944ae2e292ec0265dce1f Mon Sep 17 00:00:00 2001 From: Heng Sin Low Date: Fri, 18 Jan 2013 15:27:07 +0800 Subject: [PATCH] IDEMPIERE-443 Lookup not working until you click somewhere else. Fixed selenium fitnesse fixture broken by the lookup menu event handling change. --- .../src/fitlibrary/zk/ZkFixture.java | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/org.idempiere.ui.zk.selenium/src/fitlibrary/zk/ZkFixture.java b/org.idempiere.ui.zk.selenium/src/fitlibrary/zk/ZkFixture.java index 095f6b8eef..5bc8a9544d 100644 --- a/org.idempiere.ui.zk.selenium/src/fitlibrary/zk/ZkFixture.java +++ b/org.idempiere.ui.zk.selenium/src/fitlibrary/zk/ZkFixture.java @@ -60,7 +60,9 @@ public class ZkFixture extends SpiderFixture { List list = webDriver.findElements(Zk.jq(locator + " @comboitem")); if (list != null && list.size() > 0) { for(WebElement element : list) { - if (element.getText().equals(label) || element.getText().trim().equals(label)) { + widget = new Widget("#"+element.getAttribute("id")); + String elementLabel = (String) widget.eval(webDriver, "getLabel()"); + if (elementLabel.equals(label)) { element.click(); waitResponse(); String selected = comboboxSelectedValue(locator); @@ -129,8 +131,13 @@ public class ZkFixture extends SpiderFixture { // ---- window ( tab ) --- @SimpleAction(wiki = "|''open window''|menu label|", tooltip = "Open window with label.") - public void openWindow(String label) { - comboboxSetText("$treeSearchCombo", label); + public void openWindow(String label) { + Widget widget = new Widget("$treeSearchCombo"); + String search = label.indexOf("&") > 0 ? label.substring(0, label.indexOf("&")) : label; + WebElement element = widget.$n(webDriver, "real"); + element.sendKeys(search); + waitResponse(); + comboboxSelectItem("$treeSearchCombo", label); } @SimpleAction(wiki = "|''window''|xpath, id or other locator|''click process button''|button id|", tooltip = "Click a window's process button.")