Skip to content

Instantly share code, notes, and snippets.

@jarib
Created May 15, 2014 18:23
Show Gist options
  • Save jarib/4f680ae9ccfa2a6faf55 to your computer and use it in GitHub Desktop.
Save jarib/4f680ae9ccfa2a6faf55 to your computer and use it in GitHub Desktop.
require 'selenium-webdriver'
chrome_service = Selenium::WebDriver::Chrome::Service.default_service
chrome_service.start
pids = []
8.times do |n|
pids << fork do
driver = Selenium::WebDriver.for :chrome, :url => chrome_service.uri
driver.get 'http://google.com'
driver.first(name: 'q').send_keys("proc #{n}")
driver.quit
end
end
pids.each { |pid| Process.waitpid pid }
chrome_service.stop
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment