Selenium Window Full Screen

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

Selenium fullscreen() method example

package testPackage;

import org.openqa.selenium.WebDriver;

public class fullscreenExample{

	public static void main(String[] args) {
		System.setProperty("", "D:\\chromedriver.exe");
		WebDriver driver=new ChromeDriver();		
		//Fullscreen the browser window.	

In above given example, fullscreen() method will resize the window size to full screen.

No comments:

Post a Comment