WebDriver??????????
???????????? ???????[ 2015/2/13 16:23:50 ] ????????WebDriver ??????????
	???????? ???????? ?????н??
	package com.example.tests;
	import java.io.File;
	import org.apache.commons.io.FileUtils;
	import org.junit.*;
	import org.openqa.selenium.*;
	import org.openqa.selenium.ie.InternetExplorerDriver;
	public class Selenium2 {
	@Test
	public void testTakesScreenshot() {
	WebDriver driver = new InternetExplorerDriver();
	driver.get("http://www.baidu.com");
	try {
	File srcFile = ((TakesScreenshot)driver).
	getScreenshotAs(OutputType.FILE);
	FileUtils.copyFile
	(srcFile??new File("d:\screenshot.png"));
	} catch (Exception e) {
	e.printStackTrace();
	}
	driver.close();
	}
	}
	????TakesScreenshot???????getScreenshotAs()????????????????????????У??????????OutputType.FILE????????????getScreenshoAs()???????????????????????????????????
	?????????????RemoteWebDriver() ?????????????
	???????????selenium java -jar selenium-server-standalone-2.25.0.jar
	package com.example.tests;
	import java.io.File;
	import java.io.IOException;
	import java.net.MalformedURLException;
	import java.net.URL;
	import org.apache.commons.io.FileUtils;
	import org.junit.*;
	import org.openqa.selenium.*;
	import org.openqa.selenium.remote.*;
	public class Selenium2 {
	@Test
	public void testRemoteWebDriverScreenShot() {
	//????????????
	DesiredCapabilities capability = DesiredCapabilities.internetExplorer();
	WebDriver driver = null;
	try {
	driver = new RemoteWebDriver( //?????localhost??????
	new URL("http://localhost:4444/wd/hub")?? capability);
	} catch (MalformedURLException e) {
	e.printStackTrace();
	}
	driver.get("http://www.sina.com.cn");
	//??????????н??
	driver = new Augmenter().augment(driver);
	File scrFile =
	((TakesScreenshot)driver).getScreenshotAs(OutputType.FILE);
	try {
	FileUtils.copyFile(scrFile?? new File("D:\screenshot.png"));
	} catch (IOException e) {
	e.printStackTrace();
	}
	}
	}
??????
					
					???·???
App??С????H5?????????????????Щ??
2024/9/11 15:34:34?????????????????????????
2024/9/10 11:13:49P-One ???????????????????????????????????????
2024/9/10 10:14:12???????????????????????????
2024/9/9 18:04:26??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44
					
			
								
								
								
								
								
								
								
								
								
								
				
sales@spasvo.com