Welcome, Let’s see a quick way to launch a website in fullscreen mode using Selenium fullscreen() from Window Interface.

Method Details – void fullscreen()

Fullscreen the current window if it is not already fullscreen.

package fullscreendemo;

import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;

public class PageFullScreen {

	public static void main(String[] args) throws InterruptedException 
	{
		// set chromedriver path
		System.setProperty("webdriver.chrome.driver", "D:\\browser-drivers\\chromedriver.exe");
		// instantiate object
		WebDriver driver = new ChromeDriver();
		// launch website
		driver.get("https://www.walmart.com/");
		// make website fullscreen
		driver.manage().window().fullscreen();
		// wait for sometime
		Thread.sleep(2000);
		// quit browser
		driver.quit();
	}

}