Lec 3 || How to resize web browser to specific location || Selenium-WebDriver tutorials - Math Traders

Latest

Lec 3 || How to resize web browser to specific location || Selenium-WebDriver tutorials



                                  Lec 3 ||  Resize web browser 



Lecture agenda: in this lecture you will learn how to resize a web browser. 

Summary: by now you have already learnt that how to launch a web browser and you have also learn to how to maximize web browser in previous lectures. Now in this lecture you will learn how to write a script which maximizes a web browser. Let's understand through an example.

                                                                        Script


package seleniumQA;

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

public class Blogger {

public static void main(String[] args) {
// Set Browser property
System.setProperty("webdriver.chrome.driver", "C:\\Users\\Arun Datt Kaushik\\Downloads\\Selenium\\chromedriver.exe");
// Open Web browser
WebDriver driver = new ChromeDriver();
// Launch URL
driver.get("https://www.google.com");

                Dimesion d = new Dimension(300, 200);
// Resizing browser
driver.manage().window().setSize(d);

}
}

Selenium-WebDriver tutorials

Up Next                                                                       

Lec 4 || Launching Chrome Browser

Lec 2 || Launching Chrome Browser

No comments:

Post a Comment