I'm trying to test a travel website. When I enter the city code, the correct airport should be picked from the list. However, it enters the city code and does not proceed to pick up the city from the list.
@org.testng.annotations.Test
public void flightTest() throws InterruptedException {
driver = new ChromeDriver();
driver.manage().window().maximize();
driver.manage().timeouts().implicitlyWait(Duration.ofSeconds(5));
driver.get("https://phptravels.net/");
//--------------- Departure -------------------
WebElement fromBox = driver.findElement(By.name("from"));
fromBox.sendKeys("DAC");
wait = new WebDriverWait(driver, Duration.ofSeconds(10));
By lst1 = By.xpath("//div[@class='most--popular-from fadein results-container-from rounded-2 shadow border-0']//button[text()='DAC']");
Thread.sleep(1000);
WebElement from = wait.until(ExpectedConditions.visibilityOfElementLocated(lst1));
Thread.sleep(1000);
from.click();
//--------------- Destination -------------------
WebElement toBox = driver.findElement(By.name("to"));
toBox.sendKeys("JED");
wait = new WebDriverWait(driver, Duration.ofSeconds(10));
By lst2 = By.xpath("//div[@class='d-flex align-items-center p-2 to--insert overflow-hidden result-option']//button[text()='JED']");
WebElement to = wait.until(ExpectedConditions.visibilityOfElementLocated(lst2));
Thread.sleep(1000);
to.click();
}