标签:多少 ddc code oca public date new mat web
public void login(WebDriver WebDriver,String cookie1[],String cookie2[]) throws ParseException{//登陆需要多少个cookie就加多少个参数 String s1 = "Thu 12 Jul 3000 09:43:08 GMT"; SimpleDateFormat dateFormat = new SimpleDateFormat("EEE dd MMM yyyy hh:mm:ss z", Locale.ENGLISH); Date date1 = dateFormat.parse(s1); Cookie cookie1 = new Cookie("cookie的名称1", cookie1[0],cookie1[1],cookie1[2], date1); Cookie cookie2 = new Cookie("cookie的名称2", cookie2[0], cookie2[1], cookie2[2], date1); WebDriver.get("登陆地址");//需要和登陆后的地址域名相同 WebDriver.manage().addCookie(qlzb_sessionid); WebDriver.manage().addCookie(jssessionid); WebDriver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS); WebDriver.get("登陆后跳转的地址"); }
public String[] cookie1 = {"初始化","初始化","初始化"};
public String[] cookie2 = {"初始化","初始化","初始化"};
cookie1[0] = "value";//cookie的值,Value cookie1[1] = "domain";//cookie的域,Domain cookie1[2] = "/";//cookie的path cookie2[0] = "value"; cookie2[1] = "domain"; cookie2[2] = "/";
标签:多少 ddc code oca public date new mat web
原文地址:http://www.cnblogs.com/yanzhe/p/7550955.html