Capybara uses Internet Explorer as a browser, not Firefox

Hi, can Capybara be told to use IE instead of always defaulting Firefox?

I need to write some automated tests, but the business only supports Internet Explorer, so I need tests that will run in this browser.

Thanks.

+6
source share
2 answers

As stated in the comments on marc_s, you can try making IE the default browser on your test computer.

I also see some google hits about using Capybara with Selenium (remote control) .

If you're interested, check out Selenium docs on how to specify a browser.

Edit It seems that the tutorial that I published earlier was only Rack. Not sure, but maybe this will work:

http://www.johng.co.uk/2010/10/13/run_capybara_and_cucumber_features_in_internet_explorer_on_remote_windows/

Capybara.app_host = "http://192.168.1.37:3000" Capybara.default_driver = :selenium Capybara.register_driver :selenium do |app| Capybara::Driver::Selenium.new(app, :browser => :remote, :url => "http://192.168.1.127:4444/wd/hub", :desired_capabilities => :internet_explorer) end 

He still needs Selenium.

Edit 2:

If you get this error:

Capybara :: TimeoutError: failed to resynchronize, ajax timeout

Then try adding this code to features/step_definitions/mydefiniation.rb :

 Before do page.driver.options[:resynchronize] = false end 

See this question about this specific issue: Using Capybara for AJAX Integration Tests

+4
source

Use →

ignore_mode = opts.delete (: introduction_flakiness_by_ignoring_security_domains)! = false

Go → External libraries - selenium-webdriver - lib - selenium - webdriver - ie - bridge.rb

Update IE module -> def initialize

It contains -

ignore_mode = opts.delete (: introduction_flakiness_by_ignoring_security_domains)

just add! = false to make it →

ignore_mode = opts.delete (: introduction_flakiness_by_ignoring_security_domains)! = false

0
source

Source: https://habr.com/ru/post/892882/


All Articles