Application Delivery Management
Application Modernization & Connectivity
CyberRes by OpenText
IT Operations Management
Expectation
var window = workstation.getActiveWindow();
var list = window.describe(List.class, new ListDescription.Builder()
.nativeClass("com.nuix.swing.list.FormattedList")
.attachedText("Select the type of licence you want:")
.build());
Workaround
@Given("I select the {string} item from the {string} list")
public void iSelectTheOptionFromTheDropdown(String itemName, String listName) throws GeneralLeanFtException, CloneNotSupportedException
{
var window = workstation.getActiveWindow();
var lists = window.findChildren(List.class, new ListDescription.Builder()
.nativeClass("com.nuix.swing.list.FormattedList")
.build());
var list = Arrays.stream(lists).filter(entry -> {
try
{
return entry.getAttachedText().startsWith(listName);
}
catch (GeneralLeanFtException ex)
{
throw new RuntimeException(ex);
}
}).findFirst();
assertThat(list.isPresent(), is(true));
var item = list.get().getItems().stream().filter(entry -> {
try
{
return entry.getText().startsWith(itemName);
}
catch (GeneralLeanFtException ex)
{
throw new RuntimeException(ex);
}
}).findFirst();
assertThat(item.isPresent(), is(true));
list.get().select(item.get().getIndex());
}
Regards
Ampion Product Support