0

Sample image with disabled drop down: Sample image with disabled drop down

tried:

Select select = new Select(driver.findElement(dropDownLocator));
List<WebElement> all_Options=select.getOptions();
Raju
  • 21
  • 5
  • 1
    What have you tried yourself? What was the result of this? What is the expected result? – RemcoW Jun 21 '16 at 10:05
  • Select select=new Select(driver.findElement(dropDownLocator)); List all_Options=select.getOptions(); – Raju Jun 21 '16 at 10:08
  • getting value as "" – Raju Jun 21 '16 at 10:09
  • 1
    Please add that along with the html for the image to the question itself, using the appropriate code blocks. Otherwise it's gonna be hard for us to help you – RemcoW Jun 21 '16 at 10:13
  • Instead of adding an image, please add the text of the HTML to the question. One day that image will no longer be available and then this question will be much less useful. – JeffC Jun 21 '16 at 15:21
  • Possible duplicate of [Selenium WD - get value of disabled input](http://stackoverflow.com/questions/11429070/selenium-wd-get-value-of-disabled-input) – JeffC Jun 21 '16 at 15:22

1 Answers1

0
WebElement select = driver.findElement(By.xpath("//select[@name='jobName']")); 
List<WebElement> all_Options = select.findElements(By.tagName("option");

string val1 = all_Options[0].getText();
ThinkBonobo
  • 15,487
  • 9
  • 65
  • 80
Leon Barkan
  • 2,676
  • 2
  • 19
  • 43