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

+1 vote
Oct 28, 2019 in Selenium by Pavithra
• 130 points
209 views

1 answer to this question.

0 votes
@Pavithra, you can try using following commands to handle a combobox:

WebElement ele = driver.findElement(By.id("cmbLocation"));
ComboBox combo = new ComboBox(ele);
combo.expand();
List<WebElement> lis = ele.findElements(By.className("ListBoxItem"));
lis.get(15).click();
answered Oct 29, 2019 by Abha
• 27,740 points

Related Questions In Selenium

0 votes
1 answer

How to open a browser window in full screen using Selenium WebDriver with C#

Simply Use this: driver.Manage().Window.Maximize(); READ MORE

answered Jun 7, 2018 in Selenium by Samarpit
• 5,850 points
5,262 views
0 votes
5 answers
0 votes
1 answer

How to print text from a list of all web elements with same class name in Selenium?

@Rajni, following test case is somewhat similar ...READ MORE

answered Jun 20, 2019 in Selenium by Avantika
4,281 views
0 votes
1 answer
0 votes
1 answer

Open new tab instead of a new window in Selenium WebDriver

The current version of Selenium do not ...READ MORE

answered Jun 22, 2018 in Selenium by Meci Matt
• 9,460 points
1,213 views
0 votes
1 answer

How to get the HTML source of a webpage using Selenium in Java?

There is a method called getPageSource() in ...READ MORE

answered Jan 10, 2019 in Selenium by Sneha
2,288 views
0 votes
2 answers

How to open a new tab in existing browser window using Javascript Executor?

Hi Meenal, you can use executeScript() method ...READ MORE

answered Jul 22, 2019 in Selenium by Abha
• 27,740 points
1,195 views
0 votes
1 answer

How to create a test case with TestNG in Selenium?

Hey Deepak, to create a Test Case ...READ MORE

answered May 21, 2019 in Selenium by Abha
• 27,740 points
97 views