Getting errors while trying to run my tests on Safari, I am using Ruby with Capybara

I am getting errors when trying to run the tests in Safari, they are working a expected with Chrome/Firefox. On Safari I am getting the error “{“status”:33,“value”:{“error”:“session not created”,“message”:"Unable to create new service: GeckoDriverService\nBuild info: version: ‘3.13.0’, revision: ‘2f0d292’,

Can you confirm if there is something wrong with my configuration for Safari

            ActionController::Base.allow_forgery_protection = true

            Capybara.register_driver :lambdatest do |app|
            capabilities = Selenium::WebDriver::Remote::Capabilities.new

            capabilities["build"] = "your build name"
            capabilities["name"] = "your test name"
            capabilities["platform"] = "MacOS Catalina"
            capabilities["browserName"] = "Safari"
            capabilities["version"] = "13.0"
            capabilities["tunnel"] = true
            Capybara::Selenium::Driver.new(app, 
            :url => "https://username:#{ENV['LT_KEY']}@hub.lambdatest.com/wd/hub", 
             desired_capabilities: capabilities)

             Capybara.current_driver = :lambdatest
2 Likes

The can be fixed by setting browser: :remote in driver initialization like this:

Capybara::Selenium::Driver.new(app, browser: :remote, :url => “https://username:#{ENV[‘LT_KEY’]}@hub.lambdatest.com/wd/hub”, desired_capabilities: capabilities)

Give it a try and feel free to reach out in case you have any questions