2014年2月14日
摘要: selenium2集成了TakeScreenshot插件,可以支持浏览器截图功能File screenShotFile = ((TakesScreenshot) dr).getScreenshotAs(OutputType.FILE ); FileUtils.copyFile (screenShotFile, new File("D:/JIETU.PNG"));完成代码: 1 import java.io.File; 2 import java.io.IOException; 3 4 import org.apache.commons.io.FileUtils; 5 imp 阅读全文
posted @ 2014-02-14 14:06 Minecaft我的世界 阅读(300) 评论(0) 推荐(0) 编辑
摘要: 1 import org.openqa.selenium.WebDriver; 2 import org.openqa.selenium.firefox.FirefoxDriver; 3 import org.openqa.selenium.os.WindowsUtils; 4 /* 5 * 结束进程 6 */ 7 public class KillProcess { 8 9 public static void main(String[] args) {10 //结束进程11 WindowsUtils.tryToKillByName("fire... 阅读全文
posted @ 2014-02-14 13:41 Minecaft我的世界 阅读(609) 评论(0) 推荐(1) 编辑
摘要: 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 //定向URL12 driver.... 阅读全文
posted @ 2014-02-14 13:38 Minecaft我的世界 阅读(1114) 评论(0) 推荐(0) 编辑