@Test
@ParameterizedTest
@CsvSource({
})
public void test_12306_search(自定义,,自定义,String screenShot) throws InterruptedException {
//元素定位
WebElement 自定义 = driver.findElement(By.id(""));
WebElement 自定义 = driver.findElement(By.xpath(""));
WebElement 自定义 = driver.findElement(By.className(""));
WebElement 自定义 = driver.findElement(By.linkText(""));
//键盘操作
自定义.clear();
自定义.sendKeys(自定义String定义);
Keys.ENTER(回车)
Keys.TAB
Keys.SPACE(空格)
Keys.ESCAPE(esc)
Keys.CONTROL,"a"(全选 ctrl+a)
//鼠标点击
driver.findElement(By.xpath("")).click();
query.contextClick();(右击)
//跳转页面、等待、截图
driver.switchTo().window(driver.getWindowHandles().toArray()[1].toString());
Thread.sleep(1000);
takeScreenshot(screenShot);
driver.switchTo().frame(iframe); (iframe窗口切换)
//鼠标悬停
Actions actions = new Actions(driver);
WebElement moreBtn=driver.findElement(By.xpath(""));
actions.moveToElement(moreBtn).perform();
}
//下拉框选择
WebElement el = driver.findElement(By.xpath(""));
Select sel = new Select(el);
sel.selectByValue("20");
//拖拽
actions.clickAndHold();
actions.moveByOffset(,);
actions.release();