M_K
M_K

Reputation: 139

How to set cookie using selenium in IE

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

Answers (3)

Sungsoo
Sungsoo

Reputation: 1

Check IE driver version. I resolved this problem by changing 64 -> 32 bit version driver.

Upvotes: 0

mtkopone
mtkopone

Reputation: 6443

You can work around the bug by doing this instead:

selenium.getEval("selenium.browserbot.getCurrentWindow().document.cookie = 'name=value;path=/'")

Upvotes: 0

Related Questions