Tag: 闪光

Chrome 62和Flash

我有一个基于Flash的应用程序,我需要使用Cucumber进行测试。 由于默认情况下未启用闪存,因此我需要在每次测试之前启用它,并将我认为的url列入白名单。 如果我暂停测试的后台阶段,我可以手动设置这些选项。 我怎么能自动化这种方法,我已经考虑过添加options和preferences ,但似乎仍然无法开始工作。 所以这是我在env.rb文件中的标准设置 Capybara.register_driver :chrome do |app| chrome_binary = ‘/Applications/Google Chrome.app’ capabilities = Selenium::WebDriver::Remote::Capabilities.chrome(“chromeOptions” => { “binary” => chrome_binary + ‘/Contents/MacOS/Google Chrome’ }) Capybara::Selenium::Driver.new(app, :browser => :chrome, :desired_capabilities => capabilities, :options => options) end 进一步阅读强调了诸如此类的选项 options = Selenium::WebDriver::Chrome::Options.new options.add_argument(‘arg-here’) prefs = {“enable flash here ? “} options.add_experimental_option(“prefs”, prefs) undefined method add_experimental_option for […]