1 import org.openqa.selenium.WebDriver; 2 import org.openqa.selenium.firefox.FirefoxDriver; 3 /* 4 * 浏览器最大化 5 */ 6 public class Bowser_max { 7 8 public static void main(String[] args) { 9 //初始化浏览器对象 10 WebDriver driver = new FirefoxDriver(); 11 //定向URL 12 driver.get("http://www.baidu.com/"); 13 //浏览器最大化 14 driver.manage().window().maximize(); 15 } 16 }
原文:http://www.cnblogs.com/xiaot87/p/3549456.html