Method: Capybara::Session#open_new_window

Defined in:
lib/capybara/session.rb

#open_new_window(kind = :tab) ⇒ Capybara::Window

Open a new window. The current window doesn't change as the result of this call. It should be switched to explicitly.

Returns:



484
485
486
487
488
489
490
491
492
# File 'lib/capybara/session.rb', line 484

def open_new_window(kind = :tab)
  window_opened_by do
    if driver.method(:open_new_window).arity.zero?
      driver.open_new_window
    else
      driver.open_new_window(kind)
    end
  end
end