2016-08-09 102 views

Antwort

0

Diese Frage wurde hier beantwortet - Selenium Select - Selecting dropdown option by part of the text

Unten ist der Ausschnitt aus der Antwort:

List <WebElements> optionsInnerText= driver.findElements(By.tagName("option")); 

for(WebElement text: optionsInnerText){ 

String textContent = text.getAttribute("textContent"); 

if(textContent.toLowerCase.contains(expectedText.toLowerCase)) 

     select.selectByPartOfVisibleText(expectedText); 
}