![](/img/trans.png)
[英]Capybara/Selenium/Chrome: test passes only when calling save_screenshot
[英]Undefined method for save_screenshot for Capybara and Poltergeist
我正在使用capybara(1.1.4),poltergeist(1.0.2)和rails(3.2.13)。 我正試圖截取屏幕來調試我得到的一些錯誤。 然而,水豚和poltergeist保存截圖方法都不起作用。 當我做poltergeist(我的所有測試都有js:true)時,我得到了這個:
Failure/Error: save_screenshot('test.png')
NoMethodError:
undefined method `save_screenshot' for #<RSpec::Core::ExampleGroup::Nested_1:0x007fb5fcce3178>
當我做Capybara的方式時,我得到了這個:
Failure/Error: page.save_screenshot('screenshot.png')
NoMethodError:
undefined method `save_screenshot' for #<Capybara::Session>
我完全不知道為什么這不起作用,谷歌搜索已經完全沒有用了。 如果您需要更多信息,請詢問,我會盡快回復。 我非常感謝你的幫助!
我注意到你說你在使用poltergeist 1.0.2但你使用的語法來自更高版本 。 嘗試升級到1.3.0版。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.