test1000

来源:互联网 发布:淘宝出售可非大力小泰 编辑:程序博客网 时间:2024/06/05 14:39
package Ccwp;
import org.openqa.selenium.By;
//import org.openqa.selenium.JavascriptExecutor;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebDriver.Navigation;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.chrome.ChromeDriver;


public class test1000 {


/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
System.setProperty("webdriver.chrome.driver","E:\\autotest\\chromedriver_win3224\\chromedriver.exe");
//System.setProperty("webdriver.chrome.driver","E:\\GoogleChrome39/GoogleChrome39/GoogleChromePortable.exe");
 WebDriver driver1=new ChromeDriver();
// JavascriptExecutor jse=(JavascriptExecutor) driver1;
 Navigation navigation1=driver1.navigate();
//navigation1.to("http://ccwp.sit.sf-express.com/service/setLogin?openId=BCED0272E8303D139EE9879BDAA56B72&phone=13692212840&channel=3");
try{Thread.sleep(4000);
}catch(InterruptedException e){e.printStackTrace();}
navigation1.to("http://ccwp.sit.sf-express.com/page/tencent/index.html");
WebElement jijian=driver1.findElement(By.xpath("//*[@id='wrapper']/section[1]/ul/li[2]/a/h3"));
jijian.click();
try{Thread.sleep(4000);
}catch(InterruptedException e){e.printStackTrace();}
for(int i=1;i<=1000;i++)
{ driver1.navigate().refresh();
try{Thread.sleep(1000);
}catch(InterruptedException e){e.printStackTrace();}
}
}
 



}
0 0