SeleniumHQ / selenium

A browser automation framework and ecosystem.
https://selenium.dev
Apache License 2.0
30.77k stars 8.2k forks source link

Capybara giving error when executing in firefox using selenium WebDriver as 'Net::ReadTimeout: Net::ReadTimeout ' #8517

Closed AbhijayGhadyale closed 4 years ago

AbhijayGhadyale commented 4 years ago

OS - Windows 10 Firefox version - 78.0.2

gem installed

source 'http://rubygems.org'

gem 'capybara', '~> 3.13', '>= 3.13.2' # Released: January 24, 2019 gem 'rspec', '~> 3.8' # Released: August 4, 2018 gem 'rubocop', '~> 0.65.0' # Released: Feb 19, 2019 gem 'selenium-webdriver', '~> 3.141' # Released: November 1, 2018 gem 'launchy', '~> 2.4', '>= 2.4.3' # Released November 3, 2014 gem 'webdrivers', '~> 4.1.0' # Released October 7, 2019 gem 'ffi', '~> 1.11', '>= 1.11.3' gem 'cucumber' gem 'cucumber-core' gem 'cucumber-tag_expressions' gem 'report_builder' gem 'capybara-screenshot'

creating a cucumber BDD Test Cases and executing in firefox using capybara code

env.rb file as

require 'bundler/setup' Bundler.require

require 'capybara/cucumber' require 'rspec' include Capybara::DSL require 'capybara/dsl' require 'rspec/core' require 'rspec/expectations' include RSpec::Matchers require 'selenium/webdriver' require 'report_builder' require 'capybara-screenshot/cucumber'

Capybara.configure do |config| config.run_server = false config.default_driver = :selenium #:selenium_chrome config.app_host = "https://parabank.parasoft.com/" config.save_path = "./FailedSnapshots/" config.default_max_wait_time=10

Capybara.register_driver :selenium do |app| options = { :js_errors => false, } Capybara::Selenium::Driver.new(app, :browser => :firefox)

options = Selenium::WebDriver::Firefox::Options.new(args: %w[--headless])

options = Selenium::WebDriver::Firefox::Options.new
capabilities = Selenium::WebDriver::Remote::Capabilities.firefox(
    acceptInsecureCerts: true,
    )

Capybara::Selenium::Driver.new(
    app,
    browser: :firefox,
    options: options,
    desired_capabilities: capabilities
)

end end

Firefox is launched but test case gives error image

and same properly run with chrome browser

ghost commented 4 years ago

๐Ÿ‘‹ Hi there! Thank you for creating this issue.

I am the Selenium Assistant Bot ๐Ÿค–, I triage issues in this repository. If I can't do it, I label it to help maintainers identify issues that need triaging.

I am an Open Source project ๐Ÿ™Œ, post bugs or ideas here!

ghost commented 4 years ago

โ—๏ธ It seems this issue is not using any of the supported templates

๐Ÿ’ก Supported issue types are (they start with):

Issue templates help this project to stay in shape, please use them and fill them out completely. By doing that you are helping the project because the community and maintainers can provide prompt feedback, and potentially solve the issue.

If you are asking a question, a better way to address this is:

If you think this is incorrect, please feel free to open a new issue.

Thank you for your contributions.