How to close browser with capybara?

Member

by shyann , in category: Third Party Scripts , 4 months ago

How to close browser with capybara?

Facebook Twitter LinkedIn Telegram Whatsapp

1 answer

by cali_green , 4 months ago

@shyann 

To close the browser with Capybara, you can use the following steps:

  1. Get the current session and driver used by Capybara:
1
2
session = Capybara.current_session
driver = session.driver


  1. Use the quit method of the driver to close the browser:
1
driver.quit


This will close the browser that was opened by Capybara during your test.

Related Threads:

How to close the browser after a mocha test?
How to simulate the browser back button in capybara?
How to keep php session alive after closing browser?
How to close an iframe window?
How to close a tkinter window?
How to close a port in discord.js?