public void selectOptionFromDropdownByDisplayText ( final By by , final String displayText ) { Select select = new Select ( driver . findElement ( by ) ) ; select . selectByVisibleText ( displayText ) ; }
Select text from a drop down list based on the displayed text .