?????????????????Щ??????
???????????? ???????[ 2013/9/9 14:47:28 ] ????????
????6??????EXCEL
import java.io.File;
import jxl.Workbook;
import jxl.write.Label;
import jxl.write.WritableSheet;
import jxl.write.WritableWorkbook;
public class UpdateExcel{
public static void main(String args[]){
try{
// Excel??????
Workbook wb = Workbook.getWorkbook(new File("test.xls"));
// ??????????????????????????д???????
WritableWorkbook book = Workbook.createWorkbook(new File("test.xls")??wb);
// ????????????
WritableSheet sheet = book.createSheet("????"??1);
sheet.addCell(new Label(0??0??"?????????????"));
book.write();
book.close();
}catch(Exception e){
System.out.println(e);
}
}
}
????7??WebDriver?ж??????????
import java.util.concurrent.TimeUnit;
import org.openqa.selenium.By;
import org.openqa.selenium.NoSuchElementException;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.ie.InternetExplorerDriver;
/*
* ?ж?????????????
*/
public class ElementIsExsit {
//????????????????
public boolean isElementExsit(WebDriver driver?? By locator) {
boolean flag = false;
try {
WebElement element=driver.findElement(locator);
//flag = true;
flag=null!=element;
System.out.println("???: " + locator.toString()+ " ????!");
}catch(NoSuchElementException e) {
System.out.println("???: " + locator.toString()+ " ??????!");
flag = false;
}
return flag;
}
//??????????????
public void test(){
WebDriver driver = new InternetExplorerDriver();
//??????
driver.manage().timeouts().implicitlyWait(5?? TimeUnit.SECONDS);
By locator = By.id("id");
isElementExsit(driver??locator);
}
}
????8??java??????
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.UnsupportedEncodingException;
import java.net.URI;
import java.net.URISyntaxException;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
import org.apache.http.NameValuePair;
import org.apache.http.client.ClientProtocolException;
import org.apache.http.client.HttpClient;
import org.apache.http.client.entity.UrlEncodedFormEntity;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.impl.client.DefaultHttpClient;
import org.apache.http.message.BasicNameValuePair;
import org.apache.http.util.EntityUtils;
import com.sun.org.apache.xerces.internal.impl.xpath.regex.ParseException;
public class Movision_verifyImage {
private static HttpClient hc = new DefaultHttpClient();
public static void main(String args[]) throws ClientProtocolException?? IOException?? ParseException?? URISyntaxException{
//????????????????????????????
long date = new Date().getTime();
System.out.println(date);
List<NameValuePair> params = new ArrayList<NameValuePair>();
params.add(new BasicNameValuePair("random"??Long.toString(date)));
get("http://172.16.3.6/admin/portalVerifyImage"??params);
}
/*
* ????????GET????
*
*/
public static void get(String url??List<NameValuePair> params) throws ParseException?? UnsupportedEncodingException?? IOException?? URISyntaxException{
//get????
HttpGet httpget = new HttpGet(url);
//???ò???
String str = EntityUtils.toString(new UrlEncodedFormEntity(params));
httpget.setURI(new URI(httpget.getURI().toString()+"?"+str));
//????????
HttpResponse re = hc.execute(httpget);
//?????????
HttpEntity entity = re.getEntity();
if (entity != null && entity.isStreaming()) {
File storeFile = new File("F:\test.jpg");
FileOutputStream fos = new FileOutputStream(storeFile);
// ??????????????д????????
InputStream is = entity.getContent();
byte[] b = new byte[1024];
int j = 0;
while ((j = is.read(b)) != -1) {
fos.write(b?? 0?? j);
}
fos.flush();
fos.close();
} else {
System.out.println("[" + url + "] δ???.");
return;
}
//???????
hc.getConnectionManager().shutdown();
}
}
??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11