I'm new to Selenium WebDriver. I'm testing a drop down list. Here is the code I used to select an item from the drop down.
Select dropdown = new Select(driver.findElement(By.xpath("//select")));
dropdown.selectByValue("FEM");
This is working fine, but what I need is to get selected item as a text. For an example, under the value = FEM
, the text displays is female. I need to get the text as Selected value is female.
I've searched some articles and none of this worked. Please help. :)