相关疑难解决方法(0)

等待Ajax调用以完成Selenium 2 WebDriver

我正在使用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)

c# ajax selenium selenium-webdriver

53
推荐指数
4
解决办法
8万
查看次数

标签 统计

ajax ×1

c# ×1

selenium ×1

selenium-webdriver ×1