0 votes
1 view
in Devops and Agile by (19.8k points)

I am working on Ruby On Rails integration test using capybara, Selenium.

How to set testing Browser Window Height and Width?

I searched, but nothing worked well for me.

I tried the following code.

page.execute_script('$(window).width(1200)')

Can anyone help with this?

1 Answer

0 votes
by (63.4k points)

You can use the resize_to(width, height) method which is an in-built method of selenium webdriver class.

For example, the below code snippet would resize the browser with 100px wide and 200px tall dimensions:

page.driver.browser.manage.window.resize_to(100,200)

Welcome to Intellipaat Community. Get your technical queries answered by top developers !


Categories

...