Is there a method to extract the value displayed on a disabled dropdown list? I attempted the code below:
Select select = new Select(Locator);
WebElement option = select.getFirstSelectedOption();
String text= option.getText();
Issue Encountered: The error message states that the element should have been of type 'select' but was identified as an 'input'. However, the element is indeed a 'Select' element that is just disabled.
HTML Structure:
<select class="form-control dirty-checked-field" disabled="disabled" id="Pyear" name="Sections[0].PortfolioYear" title="2019">