开发者

How add a cookie to specific domain using selenium

开发者 https://www.devze.com 2023-02-19 13:26 出处:网络
Is there a way to specify the domain in which the cookie is to be set. I foll开发者_C百科owed this way

Is there a way to specify the domain in which the cookie is to be set.

I foll开发者_C百科owed this way

selenium.open(example.com); selenium.createCookie(arg1, arg2);

Is there any way by which i can set the cookie in .example.com domain?

Note : If i open example.com it will be redirected to www.example.com


selenium.open(...);
selenium.createCookie("name=value", "domain=.example.com");

http://selenium.googlecode.com/svn/tags/selenium-2.0-rc-2/docs/api/java/com/thoughtworks/selenium/Selenium.html#createCookie%28java.lang.String%2C%20java.lang.String%29

0

精彩评论

暂无评论...
验证码 换一张
取 消