Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

Getting Started with Headless Chrome

Getting Started with Headless Chrome

Headless Chrome is delivered in Chrome 59. It allows you to run the Chrome browser in a Headless environment.

A headless browser is a great tool for automated testing and server environments where you don’t need a visible UI shell.

A while ago I wrote an article how to run tests on chrome headless using docker  but now you can make the new changes in your project.

Start chrome headless
Capybara.register_driver :chrome_headless do |app|
  capabilities = Selenium::WebDriver::Remote::Capabilities.chrome(
    chromeOptions: {
      args: %w[ no-sandbox headless disable-gpu ]
    }
  )

  Capybara::Selenium::Driver.new(app, browser: :chrome, desired_capabilities: capabilities)
end

Also you should set default_driver instead of current_driver.

Capybara.configure do |config|
  config.run_server = false
  config.default_driver = :selenium
  config.app_host = 'https://www.google.com' # change url
end

For more informations about chrome headless you should check this out.

Happy Testing!

The post Getting Started with Headless Chrome appeared first on Testingrepository - Talking about selenium , and our passion.



This post first appeared on Testing Repository - Creating Testing, please read the originial post: here

Share the post

Getting Started with Headless Chrome

×

Subscribe to Testing Repository - Creating Testing

Get updates delivered right to your inbox!

Thank you for your subscription

×