5.change Size of Browser

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 1

Change Size of Browser :

package methods_of_WebDriver;

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

public class ChangeSizeOfBrowser {

public static void main(String[] args) throws InterruptedException {


System.setProperty("webdriver.chrome.driver","E:/Soft/chrome_driver2/chromedriver.exe");
WebDriver driver=new ChromeDriver();

driver.get("https://www.google.com/");

Thread.sleep(1000);

Dimension d = new Dimension(300,700);

driver.manage().window().setSize(d);

You might also like