Rodolfo Marcos
Rodolfo Marcos

Reputation: 159

Selenium Webdriver Error - SessionNotCreatedError

I'm developing automated tests with Capybara on ruby. And I'm struggling to solve this error for days. I've tried to change chrome/chromedriver versions to every combination on earth and still getting errors! I've also reinstalled cucumber/ruby/devkit etc..

By the way, my automated tests were working pretty well, and suddenly they were not anymore.

Someone helps please!

C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/selenium-webdriver-3.0.3/lib/selenium/webdriver/remote/response.rb:69:in `assert_ok': session not created exception (Selenium::WebDriver::Error::SessionNotCreatedError)
from disconnected: Unable to receive message from renderer
  (Session info: chrome=54.0.2840.71)
  (Driver info: chromedriver=2.26.436362 (5476ec6bf7ccbada1734a0cdec7d570bb042aa30),platform=Windows NT 10.0.10586 x86_64)

    require 'capybara'
    require 'selenium-webdriver'

    Capybara.register_driver :selenium do |app|
        Capybara::Selenium::Driver.new(
            app,
            browser: :chrome
        )
    end

    Selenium::WebDriver::Chrome.driver_path = 'C:\tools\chromedriver.exe'
    Selenium::WebDriver::Chrome.path = 'C:\tools\chrome64_54.0.2840.71\chrome.exe'

    Capybara.default_driver = :selenium

    url = "https://github.com/jnicklas/capybara"
    internet = Capybara::Session.new(:selenium)
    internet.visit url

    sleep(20)

Upvotes: 1

Views: 3078

Answers (1)

ValyriA
ValyriA

Reputation: 157

I would suggest try downgrading your Chrome version to v54 or v50 and try then. From your error log it seems a http request is not being established and so the webdriver is unable to create a session. Integrate a Selenium standalone server in your project and try running the tests then. The latest version is v3.0.1, you can download it from here:

http://www.seleniumhq.org/download/

Upvotes: 1

Related Questions