2014-11-06 69 views

回答

1

是的的确的。

假设您使用的是java,请查看http://selenium.googlecode.com/svn/trunk/docs/api/java/org/openqa/selenium/Cookie.html

Cookie类的构造函数以这种方式重载,以便您可以定制要添加到cookie中的数据。

Cookie cookie = new Cookie(); //you'll need to add args since there is not a no-args constructor 

一旦被实例化,将很容易:

driver.manage().addCookie(cookie); 

我会离开更精细的细节给你,但是这应该让你开始。

相关问题