Mozmill UI 自动化和 cookie
我最近使用 Mozmill 插件/工具进行一些 UI 自动化。到目前为止,这非常有效,除了当我尝试设置然后读取一些cookie时。当我使用Mozmill设置cookie时,我似乎没有得到传统的javascript cookie行为,即我可以根据需要经常设置document.cookie,但是当我从cookie对象读取时,我总是得到最后设置的值。这是一个例子:
controller.window.document.cookie = "foo=bar";
controller.window.document.cookie = "me=too";
controller.window.alert("Cookie: " + controller.window.document.cookie); //"Cookie: me=too"
也许我不明白 cookie 在 javascript 中是如何工作的,或者它们可能不像我在 Mozmill 中假设的那样工作。 Mozmill 文档和谷歌搜索没有产生任何好的答案。预先感谢您的任何帮助。
I recently used the Mozmill addon/tool do some UI automation. This has worked really well so far, except when I'm trying to set and then read some cookies. When I use Mozmill to set cookies, I don't seem to get the traditional javascript cookie behavior, i.e. I can set document.cookie as often as I want, but I always get the last value set when I read from the cookie object. Here is an example:
controller.window.document.cookie = "foo=bar";
controller.window.document.cookie = "me=too";
controller.window.alert("Cookie: " + controller.window.document.cookie); //"Cookie: me=too"
Perhaps I don't understand how cookies work in javascript or perhaps they don't work the way I assume inside Mozmill. Mozmill documentation and google searches didn't yield any good answers. Thanks in advance for any help.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我会尝试查看Selenium。
它专为跨浏览器UI测试而设计,是一个比较成熟的项目。 Mozmill 目前用于确保 Firefox 本身(以及基于 Mozilla 的其他应用程序)正常工作。
I would try looking at Selenium.
Its designed for cross browser UI testing and is a more mature project. Mozmill is currently being used to make sure that firefox itself (and other applications based on mozilla) are working properly.