Selenium wait issue

Viewed 80

I have an input box that pulls an autocomplete list. The list is a little slow to pull, so I need selenium to just wait before pressing the enter key, which will select the first item in the list. here is what I have so far

            webDriver.FindElement(By.Id("seg-gl-1")).SendKeys("2");
            webDriver.Manage().Timeouts().ImplicitWait = TimeSpan.FromSeconds(10);
            webDriver.FindElement(By.Id("seg-gl-1")).SendKeys(Keys.Enter);

The issue is that selenium is hitting Enter too quickly. I believe I am using the implicitwait incorrectly. Can anyone shed some light on my issue?

1 Answers
Related