how to display all items in the list in the drop down?

+1 vote

Sep 29 in Selenium by Mounika
• 130 points
93 views

2 answers to this question.

0 votes

Hey Mounika, you can checkout this thread to resolve your problem: https://www.edureka.co/community/51833/how-get-options-dropdown-webpage-using-selenium-webdriver

answered Sep 30 by Abha
• 27,180 points
0 votes

Try using following code: 

 WebElement dropdown = driver.findElement(By.id("id_dropdown"));

 Select list = new Select(dropdown);

 List<WebElement> dropdown_list = list.getOptions();

 for (int i = 0; i < dropdown_list.size(); i++) {

   String dropdown_value = dropdown_list.get(i).getText();

   System.out.println("dropdown values are " + dropdown_value);

 }
answered Sep 30 by Anvi
• 13,960 points

Related Questions In Selenium

0 votes
1 answer

How to scroll the Page up or down in Selenium WebDriver? (using java)

Its pretty simple. Check out the below ...READ MORE

answered Apr 5, 2018 in Selenium by nsv999
• 5,110 points
8,548 views
0 votes
1 answer

How to choose from a drop-down in Selenium 2?

You can probably use the 'Select' class ...READ MORE

answered Apr 24, 2018 in Selenium by king_kenny
• 3,650 points
147 views
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer

How to handle drop downs using Selenium WebDriver in Java

First, find an XPath which will return ...READ MORE

answered Mar 27, 2018 in Selenium by nsv999
• 5,110 points
2,317 views
0 votes
1 answer
0 votes
1 answer

How to open a browser windows silently in the background?

It is a little bit of a ...READ MORE

answered Apr 20, 2018 in Selenium by king_kenny
• 3,650 points
342 views
0 votes
1 answer

How to handle the popup of file upload in Windows OS with WebDriver?

The value of name locator has probably ...READ MORE

answered Apr 25, 2018 in Selenium by king_kenny
• 3,650 points
3,969 views
+1 vote
1 answer

How to handle a combobox which when clicked open in new window with list of items(to be clicked) in selenium java ?

@Pavithra, you can try using following commands ...READ MORE

answered Oct 29 in Selenium by Abha
• 27,180 points
171 views