Browser window resizing and positioning can be done easily using Selenium WebDriver. Consider we have opened multiple browser windows in same machine for parallel execution; it is very useful to view execution on each window, if it is positioned and re-sized for user view at run-time.
Window Resize
view sourceprint?
1.driver.manage().window().setSize(new Dimension(100,100));
2.//Note: Dimension should be imported using org.openqa.selenium.Dimension
3.Window Position
view sourceprint?
1.driver.manage().window().setPosition(new Point(100,100));
2.//Note: Point should be imported using org.openqa.selenium.Point
Selenium WebDriver Window re-sizing & Positioning, WebDriver Window Handle | Selenium Webdriver Window Handling
Leave a Reply