Lec 2 || Write a script to maximize browser | Selenium-WebDriver tutorials - Math Traders

Latest

Lec 2 || Write a script to maximize browser | Selenium-WebDriver tutorials



                 Lec 2 || Maximizing Browser || Selenium-Java 



In this tutorial you will learn how to maximize browser in selenium once after you have setup your selenium environment in eclipse IDE. Following are the steps to maximize a browser in selenium.

1. Create a Java Project.

2. Create a package.

3. Create a class.

4. follow the steps as mentioned in the program below.


                                                              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 browser

WebDriver driver = new ChromeDriver();

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


                // Maximize browser

driver.manage().window().maximize();

}

}          

Selenium WebDriver Tutorials


Up Next                                                                       

Lec 1 || Launching Chrome Browser

Lec 3 || Launching Chrome Browser

No comments:

Post a Comment