Scenario: To search and select the first destination location that matches the input string using the below code.
driver = new ChromeDriver();
WebElement Depfield = driver.findElement(By.xpath("//div[contains(@class,'active')]//*[@name='Departure airport']"));
Issue: The instruction Depfield.sendKeys(Keys.ARROW_DOWN) is actually moving the cursor to the bottom of the search drop down list instead of the first matched option. As a result, no option is being selected by the following instruction - Depfield.sendKeys(Keys.RETURN). I have tried with for loop to go one option after the other but it didn't work.
New Update: New result
Request: Can anyone help me in resolving this issue?