Handle Autocorrect Dropdown in Java Selenium I am facing one issue when handling autocorrect dropdown, when testing manually the dropdown is working fine but when i execute the test ,and sendkeys some text the dropdown gives no suggestion, i triesby adding some wait but still not working, please help me out with this
CodePudding user response:
If you are know the option just type the complete option value using send keys. Then use sendKeys(Keys.RETURN) to the same object and try.
CodePudding user response:
I was also facing same issue. While entering text manually using keyboard, it shows the auto-complete suggestions but with Selenium it doesn't. So I have used down arrow in send keys. e.g.:
element.sendKeys(Keys.ARROW_DOWN);
Make sure that locator for element is exactly pointing to the input field (not it's parent elements). Also try using some other arrow functions or different keys like Keys.ENTER.
