黄瓜硒Webdriver内容配置

汤姆

将Selenium-webdriver与黄瓜/红宝石一起使用时,有什么方法可以确认文件的下载过程吗?

无头运行时,我使用一个简单的rspec-expectation expect(response_headers['Content-Disposition']).to include("attachment;filename#{pdf_filename}")

当我在Selenium(Chrome)中运行时,这不再起作用。我得到了错误:

Capybara::NotSupportedByDriverError: Capybara::Driver::Base#response_headers

通过Selenium运行时,有什么方法可以实现这一目标吗?

梅苏特·格尼斯(Mesut GUNES)

您可以检查下载目录中是否存在所需的文件:

File.exists? "/Users/mesutgunes/Downloads/#{pdf_filename}"

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章