如何使用selenium webdriver跳过黄瓜测试用例的图像加载。我的测试用例由于图像加载不正确而失败。当我在萤火虫的Net标签中看到时,一个旋转器滚动。
答案 0 :(得分:2)
FirefoxDriver支持loading strategy that doesn't require page to fully load。因此,驱动程序将返回而无需等待图像加载:
Capybara.register_driver :firefox do |app|
profile = Selenium::WebDriver::Firefox::Profile.new
profile['webdriver.load.strategy'] = 'unstable'
Capybara::Selenium::Driver.new(app, :browser => :firefox, profile: profile)
end
Capybara.default_driver = :firefox