在进行元素定位时常常遇到这样的alert框: 那么该如何定位并点击确定或取消按钮呢?stackoverflow上找到了这个问题的答案. OK, Show you the code: driver.findElement(By.id("updateButton")).click(); //pop up with id "updateButton" opens Alert alert = driver.switchTo().alert(); //update is ex
function alert_autoClose(title,msg,icon){ var interval; var time=1000; var x=2; //设置时间2s $.messager.alert(title,msg,icon,function(){}); interval=setInterval(fun,time); function fun(){ --x; if(x==0){ clearInterval(interval); $(".m