Skip to content

Instantly share code, notes, and snippets.

@liammagee
Created January 24, 2013 00:43
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save liammagee/4616410 to your computer and use it in GitHub Desktop.
Save liammagee/4616410 to your computer and use it in GitHub Desktop.
Increase window size for Selenium/PhantomJS
Capybara.register_driver :phantomjs do |app|
driver = Capybara::Selenium::Driver.new(app, browser: :phantomjs)
driver.browser.manage.window.resize_to(1920, 1440)
driver
end
@xam7247
Copy link

xam7247 commented Jan 8, 2015

I believe it should be driver.manage.window.resize_to ? Since driver.browser would return a symbol, and manage method won't be available on it.

@Dan2552
Copy link

Dan2552 commented Feb 22, 2023

if anybody else with a legacy app still using phantom comes across this, driver.browser.resize(x, y) worked for us

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment