Make Select use trimmed text when doing text matching
@@ -133,8 +133,11 @@ public void selectByVisibleText(String text) {
element.findElements(By.xpath(".//option[contains(., " +
Quotes.escape(subStringWithoutSpace) + ")]"));
}
+
+ String trimmed = text.trim();
+
for (WebElement option : candidates) {
- if (text.equals(option.getText())) {
+ if (trimmed.equals(option.getText().trim())) {
setSelected(option, true);
if (!isMultiple()) {
return;
