How to maximize window using ChromeOptions in Selenium
Use ChromeOptions and set a suitable argument as '--start-maximized'.
from selenium import webdriver
chrome_opts = webdriver.ChromeOptions()
chrome_opts.add_argument("--start-maximized")
driver = webdriver.Chrome(options=chrome_opts)
driver.get("https://sdetportal.blogspot.com/")
print(driver.title)
driver.quit()
from selenium import webdriver
chrome_opts = webdriver.ChromeOptions()
chrome_opts.add_argument("--start-maximized")
driver = webdriver.Chrome(options=chrome_opts)
driver.get("https://sdetportal.blogspot.com/")
print(driver.title)
driver.quit()
No comments