1、wait
wait(condition,opt_timeout,opt_message)
//10秒内id是foo的元素被定位到,然后点击它
var button = driver.wait(until.elementLocated(By.id(foo')),10000);
button.click();
2、sleep
//会拖慢脚本的执行速度
driver.sleep(3000)
1、wait
wait(condition,opt_timeout,opt_message)
//10秒内id是foo的元素被定位到,然后点击它
var button = driver.wait(until.elementLocated(By.id(foo')),10000);
button.click();
2、sleep
//会拖慢脚本的执行速度
driver.sleep(3000)