Reputation: 139
How can i set cookie using selenium in IE. For Firefox and Chrome i am able to set cookie using createCookie method. But when tried the same method for IE, it is failing.
Sample code used
selenium.open("http://www.water.com");
selenium.createCookie("name=value", "path=/")
Upvotes: 1
Views: 3154
Reputation: 1
Check IE driver version. I resolved this problem by changing 64 -> 32 bit version driver.
Upvotes: 0
Reputation: 43
Switch off "Protected mode" in IE.
http://hustoknow.blogspot.com/2011/08/trouble-with-protected-mode-in-selenium.html
Upvotes: 1
Reputation: 6443
You can work around the bug by doing this instead:
selenium.getEval("selenium.browserbot.getCurrentWindow().document.cookie = 'name=value;path=/'")
Upvotes: 0