我正在使用Selenium 2 WebDriver来测试使用AJAX的UI.
有没有办法让驱动程序等待Ajax请求完成.
基本上我有这个:
d.FindElement(By.XPath("//div[8]/div[3]/div/button")).Click();
// This click trigger an ajax request which will fill the below ID with content.
// So I need to make it wait for a bit.
Assert.IsNotEmpty(d.FindElement(By.Id("Hobbies")).Text);
Run Code Online (Sandbox Code Playgroud)