Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

812
Views
¿Cómo configurar Selenium Webdriver, Capybara y Rails Minitest?

Actualmente estoy ejecutando WSL2. He instalado google-chrome-stable y chromedriver en el sistema.

google-chrome-stable : Google Chrome 92.0.4515.131

chromedriver : ChromeDriver 92.0.4515.43

 # Gemfile group :test do gem "capybara", ">= 3.26" gem "selenium-webdriver" gem "webdrivers" end
 # test/application_system_test_case.rb class ApplicationSystemTestCase < ActionDispatch::SystemTestCase driven_by :selenium, using: :headless_chrome do |option| option.add_argument "no-sandbox" end end
 # test/system/users_test.rb class UsersTest < ApplicationSystemTestCase def setup Capybara.app_host = "http://app.example.com/" end test "user sign up" do visit new_user_path fill_in "user[name]", with: "Jane Hemmingway" fill_in "user[email]", with: "jane@example.com" fill_in "user[password]", with: "secret_password" click_button "get started" assert_redirected_to accounts_path end end

Pero cuando ejecuto esta prueba, arroja un error.

 Error: UsersTest#test_user_sign_up: Selenium::WebDriver::Error::UnknownError: unknown error: net::ERR_NAME_NOT_RESOLVED (Session info: headless chrome=92.0.4515.131) test/system/users_test.rb:9:in `block in <class:UsersTest>'

Estoy confundido acerca de lo que significa este error. ¿Hay alguna manera de que pueda arreglarlo?

over 4 years ago · Santiago Trujillo
2 answers
Answer question

0

Bien, en lugar de configurar Capybara.app_host como http://app.example.com/ , debemos configurarlo como http://app.lvh.me .

También necesitamos decirle al capibara que siempre incluya el puerto.

 # test/application_system_test_case.rb Capybara.configure do |config| config.always_include_port = true end

Ahora las pruebas se ejecutan como se esperaba.

over 4 years ago · Santiago Trujillo Report

0

El error net::ERR_NAME_NOT_RESOLVED te dice cuál es el problema. www.example.com no se resuelve en una dirección IP en cualquier máquina en la que se inicie el navegador.

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!