有一个JS代码可以通过chromedriver正常运行,但不能通过webkit正常运行。我发现以下JS无法通过webkit运行,因为该对象的键包含数字 var contactData = $selectedContact[0].dataset; # contactData object structure # {descriptionLine-1: "",descriptionLine-2: "", name: "", phone: ""}但是,它在chromedriver中可以正常工作。我尝试过的配置:Capybara.javascript_driver = :webkit # the code above does not work with webkit # rails_helper.rb require "selenium/webdriver" Capybara.register_driver :chrome do |app| options = Selenium::WebDriver::Chrome::Options.new(args: %w[no-sandbox headless disable-dev-shm-usage]) Capybara::Selenium::Driver.new(app, browser: :chrome, options: options) end Capybara.javascript_driver = :chrome如何使对象键包含数字的JS与Webkit一起使用?
添加回答
举报
0/150
提交
取消