I am having problems running the following code to click a button.
When I run as debug and step through, I can find the button and click it without any problems. But during an actual run it is unable to click the button.
Any suggestions please?
new SelectElement(Driver.FindElement(By.Name("searchType"))).SelectByText("Location");
new SelectElement(Driver.FindElement(By.Id("Location"))).SelectByText("Brentwood");
Driver.Manage().Timeouts().ImplicitlyWait(TimeSpan.FromSeconds(5));
var button = Driver.FindElement(By.ClassName("btn-go"));
button.Click();