How To Close Browser Window in Selenium WebDriver ?

How To Close the Browser Window in selenium webdriver 
Basically there are 2 method in selenium to close the browser Window
1) close Method 
2)quite Method

1)close();
 close method in selenium is used to close a single browser window .
Syntax: 

driver.close();

2)quit();
quite method in selenium is used to  close all parent and child browser windows and to end the whole session use the following Code
Syntax: 

driver.quite();

Selenium Code for close the browser window (close method )

package New;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;

public class AutomationTesting 
{
public static void main(String[] args)
 {     System.setProperty("webdriver.chrome.driver","D:\\Sandeep\\Soft\\chromedriver.exe");
 WebDriver driver= new ChromeDriver();
 driver.navigate().to("https://qaacharya.in/");
 driver.manage().window().maximize();
  driver.close();
 }
 }

Selenium code to close the browser window (quite method )


package New;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;

public class AutomationTesting
{

 public static void main(String[] args
{      System.setProperty("webdriver.chrome.driver","D:\\Sandeep\\Soft\\chromedriver.exe");WebDriver drivernew ChromeDriver();
driver.navigate().to("https://qaacharya.in/");
 driver.manage().window().maximize();
  driver.quit();
}
}

Hope!!! The above code for how to close the browser window in selenium webdriver helpful for you ...
Team 
QA acharya

Tags: how to close the browser window in selenium webdriver , selenium code for close the browser window , how to close the window in selenium , how to close the window in selenium using java
Related Post:
How To Close Browser Window in Selenium Webdriver