Unable to select an option from dropdown list i tried with select by index, label and sending hot key....

You can only use “selectOptionByLabel”, “selectOptionByValue” or “selectOptionByIndex” on a select tag. In your case, you have a div.

However, you can get the dropdown items into a list and then do your thing with the list.

Click on the arrow of the dropdown and have the list display and then right click on the list and choose “Inspect”. This should display the HTML of the list. There may be a class that is similar to each item in the dropdown.

def driver = DriverFactory.getWebDriver();
List<WebElement> list = driver.findElements(By.xpath('//div[@class="...

1 Like