Selenium rc 如何使用selenium创建cookie?
我想使用selenium创建一个cookie。我见过一个支持这种方法,比如Selenium rc 如何使用selenium创建cookie?,selenium-rc,Selenium Rc,我想使用selenium创建一个cookie。我见过一个支持这种方法,比如selenium.createcookie(arg1,arg0),但我对传递的参数有点困惑。有人能给我举个例子吗?createCookie(nameValuePair,OptionString) 创建一个新cookie,其路径和域与当前测试页面的路径和域相同,除非您明确为此cookie指定了路径 Arguments: nameValuePair - name and value of the cookie in a fo
selenium.createcookie(arg1,arg0)
,但我对传递的参数有点困惑。有人能给我举个例子吗?createCookie(nameValuePair,OptionString)
创建一个新cookie,其路径和域与当前测试页面的路径和域相同,除非您明确为此cookie指定了路径
Arguments:
nameValuePair - name and value of the cookie in a format "name=value"
optionsString - options for the cookie. Currently supported options include 'path' and 'max_age'. the optionsString's format is "path=/path/, max_age=60". The order of options are irrelevant, the unit of the value of 'max_age' is second.
论据:
Arguments:
nameValuePair - name and value of the cookie in a format "name=value"
optionsString - options for the cookie. Currently supported options include 'path' and 'max_age'. the optionsString's format is "path=/path/, max_age=60". The order of options are irrelevant, the unit of the value of 'max_age' is second.
使用firefox访问您选择的网站(创建cookie),然后进入编辑>首选项>隐私>删除单个cookie。单击其中一个cookie。这将使您了解如何使用createCookie调用。我将选项域的术语转换为主机术语,效果很好 我们可以在任何参数中给出cookie域吗?因为cookie应该被添加到某个xyz域中。请帮助我猜您可以将domain=属性设置为optionString参数中的选项之一。