rubin - Chromedriver tillader ikke headless mode ved hjælp af jruby på windows - Childprocess error

Indlæg af Hanne Mølgaard Plasc

Problem



Her er koden


puts 'requiring selenium...'
require "selenium-webdriver"

# configure the driver to run in headless mode
puts 'initializing options...'
options = Selenium::WebDriver::Chrome::Options.new
options.add\_argument('--headless')

puts 'initiating driver..'
driver = Selenium::WebDriver.for :chrome, options: options

puts 'navigating to google.com...'
driver.navigate.to "https://google.com/"

puts 'adjusting window size'
driver.manage.window.resize\_to(800, 800)

puts 'capturing screenshot...'
driver.save\_screenshot "google.png"


Det giver fejlen nedenfor, mens du starter driveren


ChildProcess::Error: Unknown error (Windows says "The operation completed successfully.", but it did not.)


Miljø

Jruby 1.7 (Ruby 2.0)

selen-webdriver 3.12.0 (nyeste)

chromedriver 2,38 (nyeste)

Windows 7

Bedste reference