特殊元素定位与操作-模态框
Modal Dialogue Box,又叫做模式对话框,是指在用户想要对对话框以外的应用程序进行操作时,必须首先对该对话框进行响应。如单击【确定】或【取消】按钮等将该对话框关闭。
- alert
- confirm
代码示例
alert代码示例
package com.test;
import org.openqa.selenium.Alert;
import org.openqa.selenium.By;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.support.ui.ExpectedConditions;
import org.openqa.selenium.support.ui.WebDriverWait;
public class SpecialElementLocate {
private static ChromeDriver chromeDriver;
public static void main(String[] args