Full Screen Window In Selenium
Selenium fullscreen() method is used to full screen the browser window. It will perform browser full screen action same as real user full screen the browser window. May be sometimes you need full screen window in your selenium tests at that time this method will be very useful for you.
- fullscreen() method is part of WebDriver.Window interface.
- It's return type is void so it returns nothing.
- It will full screen the browser window.
- Syntax : driver.manage().window().fullscreen();
Below given example will show you how fullscreen() method is used to full screen the window size.
Selenium fullscreen() method example
package testPackage;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
public class fullscreenExample{
public static void main(String[] args) {
System.setProperty("webdriver.chrome.driver", "D:\\chromedriver.exe");
WebDriver driver=new ChromeDriver();
driver.navigate().to("http://only-testing-blog.blogspot.com/2013/09/testing.html");
//Fullscreen the browser window.
driver.manage().window().fullscreen();
}
}
In above given example, fullscreen() method will resize the window size to full screen.
No comments:
Post a Comment