I am new to Selenium, could any one of you let me know how to print the value selected from \'selectByVisibleText\' in selenium?
I have run the test on Facebook login pa
Once you have selected the option by visible text, you can get the option as a WebElement
and getText()
from it.
Example:
Select select = new Select(driver.findElement(By.id("some-id")));
select.selectByVisibleText("some-text");
WebElement element = select.getFirstSelectedOption();
System.out.println(element.getText());