I'm using Selenium WebDriver for automation and I'm using Chromedriver.
I have noticed that when my driver runs and opens the chrome browser, it opens the browser with a strange size. I tried to fixed it but in vain.
Does anybody know how can I change it?
Use the ChromeOptions class An alternate method that can maximize the Chrome window is to use the ChromeOptions class. This method informs the Chrome browser explicitly to launch in maximized mode.
In Selenium, this can be easily achieved. In this article, I will show you two methods on how to Zoom In and Zoom Out in Selenium WebDriver. Manually, we have to press CTRL+ADD to do Zoom In and we have to press CTRL+SUBTRACT to do zoom out.
chrome = 57.0.2987.133 chromedriver = 2.27.440174
from selenium.webdriver.chrome.options import Options chrome_options = Options() chrome_options.add_argument("--window-size=1920,1080") driver = Chrome(chrome_options=chrome_options)
Use this for your custom size:
driver.manage().window().setSize(new Dimension(1024,768));
you can change your dimensions as per your requirements.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With