标签:sys [] gen 演示 bdr set sel 框架 send
public class frame {
public static void main(String[] args) {
// TODO Auto-generated method stub
System.setProperty("webdriver.chrome.driver", "D:\\软件\\geogle\\44.0.2403.155_chrome_installer\\chromedriver.exe");
WebDriver driver = new ChromeDriver();
driver.get("E:/资料/1. 教学课件/Java课件资料/T56 selenium/selenium演示代码/frame/frame.html");
//隐私等待
driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);
driver.switchTo().frame("top");
driver.findElement(By.name("message")).sendKeys("上面");
//回到父框架
driver.switchTo().defaultContent();
driver.switchTo().frame("left");
driver.findElement(By.name("message")).sendKeys("123");
driver.switchTo().defaultContent();
driver.switchTo().frame("main");
driver.findElement(By.name("message")).sendKeys("456");
driver.switchTo().defaultContent();
}
}
标签:sys [] gen 演示 bdr set sel 框架 send
原文地址:http://www.cnblogs.com/yyf-sally/p/6527245.html