惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Google DeepMind News
Google DeepMind News
博客园 - 聂微东
Vercel News
Vercel News
aimingoo的专栏
aimingoo的专栏
F
Fortinet All Blogs
Microsoft Security Blog
Microsoft Security Blog
MongoDB | Blog
MongoDB | Blog
B
Blog
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
WordPress大学
WordPress大学
Apple Machine Learning Research
Apple Machine Learning Research
阮一峰的网络日志
阮一峰的网络日志
大猫的无限游戏
大猫的无限游戏
GbyAI
GbyAI
Martin Fowler
Martin Fowler
M
MIT News - Artificial intelligence
The GitHub Blog
The GitHub Blog
博客园_首页
博客园 - 叶小钗
腾讯CDC
G
Google Developers Blog
Blog — PlanetScale
Blog — PlanetScale
宝玉的分享
宝玉的分享
D
Docker

博客园 - Tachikoma

用Ruby实现 Web Service Server ,并用Ruby发送 HTTP请求 Web Service Android 使用 Ksoap2 出现的低级错误... - Tachikoma Cygwin中通过RJB在Ruby下调用ICTCLAS(JAVA) ICTCLAS4J 的编译脚本 Ruby Sandbox 实现运行客户代码 - Tachikoma Ruby在使用MongoDB时,对Cursor的重新包装 ruby 下使用 ICTCLAS(JAVA) RJB 在windows下的一些安装事项 Ruby手工测试正确,rcov测试失败的解决 在dell dimension 5150 上安装 leopard 手记 Rails测试中清空数据表/载入空fixtures RDoc 解决同名module 与 Class的问题 C 实用的 e-editor 的bundle Best of Ruby Quiz - Animal Quiz Best of Ruby Quiz - GEDCOM Parser Best of Ruby Quiz - MadLib - Tachikoma 使用selenium-on-rails的一些讨论 3]assertXpathCount的使用 使用selenium-on-rails的一些讨论 [0,1] 关于 rails ActiveRecord 属性 以及 foreign_key 不直接用数据库项目 时的一些讨论
使用selenium-on-rails的一些讨论 2]清理缓存 - Tachikoma - ...
Tachikoma · 2008-04-27 · via 博客园 - Tachikoma

2. selenium-on-rails 清理cache
并没有提供这个功能,但是在测试开始时确实需要,方案在Align书的"基于时间的缓存失效策略"里描述了,就是删除文件夹tmp/cache
这里直接清理tmp文件夹

# selenium-on-rails/lib/selenium-on-rails/paths.rb
def tmp_path
      File.expand_path File.join(RAILS_ROOT,
'tmp')
end

# selenium
-on-rails/lib/controllers/selenium-controller.rb

def tmp_clear  ## tachikoma add
    FileUtils.rm_r Dir.glob(tmp_path
+"/*")
    RAILS_DEFAULT_LOGGER.info(
"Tmp directory fully sweeped.")
    render :file 
=> view_path('tmp_clear.rhtml')
end

另外做一个tmp_clear.rhtml就可以了
在测试文件中调用

open '/selenium/tmp_clear"

就OK