combobox-testBench 23.6.0
ComboBoxElement.getOptions() may return empty array if the values are still being loaded. Solution is to wait until Combo is ready.
Fix:
/**
* @return true if ComboBox is still loading items and populating its dropdown.
*/
public boolean isLoading() {
return getPropertyBoolean("loading");
}
/**
* Wait until ComboBox is finished populating its dropdown.
*/
public void waitWhileLoading() {
while (isLoading()) {
try {
Thread.sleep(200);
} catch (InterruptedException e) {
throw new RuntimeException(e);
}
}
}
@Override
public List<String> getOptions() {
// wait until the ComboBox dropdown is populated. Otherwise, we'll get an empty list of options.
waitWhileLoading();
return super.getOptions();
}