0
Hello everyone, I’m trying to access as shown in the image, a multi-select, which is in the yellow list, in ul and li, an option of Languages: Arabic, Bulgarian etc., and when selected, it goes to the box of the selected (green), passing to the list of div (indicated by the green line)
I tried those and nothing:
WebElement mySelectElement = driver.findElement(By.cssSelector("ul.ui-autocomplete"));
Select dropdown= new Select(mySelectElement);
dropdown.selectByIndex(2);
or
WebElement select = driver.findElement(By.cssSelector("ul.ui-autocomplete li:nth-of-type(2)"));
List<WebElement> options = select.findElements(By.tagName("li"));
for (WebElement option1 : options) {
if("Arabic".equals(option1.getText().trim()))
option1.click();
}