303132333435363738
} } Thread.sleep(1000); System.out.println("browser will be close"); dr.quit(); } }
272829303132333435
// ����2: ֱ�Ӷ�λlink dr.findElement(By.linkText("Home")).click(); Thread.sleep(1000); System.out.println("browser will be close"); dr.quit(); } }
323334353637383940
} }); Thread.sleep(1000); System.out.println("browser will be close"); dr.quit(); } }
121314151617181920
System.out.printf("now accesss %s \n", url); dr.get(url); Thread.sleep(2000); System.out.println("browser will be close"); dr.quit(); } }
313233343536373839
// clear element.clear(); Thread.sleep(1000); System.out.println("browser will be close"); dr.quit(); } }
232425262728293031
dr.findElement(By.cssSelector("input[type=file]")).sendKeys("src/navs.html"); Thread.sleep(1000); System.out.println("browser will be close"); dr.quit(); } }
67891011121314
public static void main(String[] args) { WebDriver dr = new ChromeDriver(); dr.manage().window().setSize(new Dimension(240, 320)); dr.get("http://www.3g.qq.com/"); dr.quit(); } }
252627282930313233
System.out.println(dr.findElement(By.tagName("h3")).getCssValue("font")); Thread.sleep(1000); System.out.println("browser will be close"); dr.quit(); } }
WebElement current = dr.findElement(By.className("breadcrumb")).findElement(By.className("active")); System.out.println(current.getText()); Thread.sleep(1000); System.out.println("browser will be close"); dr.quit(); } }
dr.manage().addCookie(c1); dr.manage().addCookie(c2); System.out.println("browser will be close"); dr.quit(); } }