Setting the size of Browser Window + Selenium and Capybara

window = Capybara.current_session.driver.browser.manage.window
 window.resize_to(1200, 800)

You can add this inside setup block.
class CapybaraIntegrationTest < ActionDispatch::IntegrationTest
  # Make the Capybara DSL available in all integration tests
  include Capybara::DSL

  setup do
    window = Capybara.current_session.driver.browser.manage.window
    window.resize_to(1250, 800)
  end
end

Comments

Popular posts from this blog

Inserting and Moving elements inside Ruby Array

Remove duplicates from a JavaScript Array

Sending Binary Data over the Network with Json