Selenium RC - 禁用浏览器Cookie [英] Selenium RC - disabling browser cookie

查看:588
本文介绍了Selenium RC - 禁用浏览器Cookie的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以使用selenium,RC禁用浏览器cookie?如果是这样,什么是api调用或调用顺序,使这种情况发生。有一个功能正在测试,当需要验证Cookie的启用或禁用的行为。感谢

Is it possible to disable a browser cookie using selenium, RC specifically? If so, what is the api call or sequence of calls to make this happen. There is a feature being tested where theres a need to verify the behavior when cookies are enabled or disabled. Thanks

推荐答案

如评论中所指定。如果使用FF,可以指定要使用的配置文件。

As specified in the comment. If you are using FF, you could specify the profile to be used.

这样做的方式是指定browserStartCommand( DefaultSelenium 构造函数的第三个参数) :

The way to do it it so specify the browserStartCommand (3rd argument of the DefaultSelenium constructor) to something similar to:

*custom "C:/Program Files/Mozilla Firefox/firefox.exe" -no-remote -profile "C:/Some/Path/To/Mozilla/Firefox/Profiles/selenium"

已停用Cookie。

这篇关于Selenium RC - 禁用浏览器Cookie的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆