}
return selected_element.getAttribute("value");
}
public String get_selected_option_text() {
final Element selected_element = getSelectedElement();
if(selected_element.is_null()) {
return StringUtils.EMPTY;
}
final Elements all_labels = findElements(By.tagName("label"));
Element selected_element_label = all_labels.findFirstElementThatMatches(new Predicate<Element>() {
public boolean apply(Element input) {
String label_for = input.getAttribute("for");
return StringUtils.equals(label_for, selected_element.getAttribute("id"));
}
});
if(selected_element_label.is_null()) {
return StringUtils.EMPTY;
}
return selected_element_label.getText();
}