請幫我在Safari處理警報如何處理硒中SafariDriver的警報?
結果,我在這下面得到的是Safari瀏覽器無法處理警報那麼,有沒有其他的方法來處理
package Default;
import java.util.concurrent.TimeUnit;
import org.openqa.selenium.Alert;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.safari.SafariDriver;
public class Safari_demo {
public static void main(String[] args) throws InterruptedException{
WebDriver driver = new SafariDriver();
driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);
driver.get("http://www.htmlite.com/JS002.php");
Thread.sleep(6000);
Alert alert = driver.switchTo().alert();
alert.accept();
driver.close();
}
}
任何解決方案?它似乎不支持,這完全限制了很多硒測試的Safari – uchuugaka 2015-04-21 05:04:11