Latest Posts

Difference between driver.close() and driver.quit()

The difference between close() and quit() function is as follows:

close() function closes the current tab on which the control of web-driver is present. It will not close other tabs of the browse.

quit() function closes the complete browser that is opened by web-driver.




package demopackage; import org.openqa.selenium.By; import org.openqa.selenium.WebDriver; import org.openqa.selenium.chrome.ChromeDriver; public class TestClass { public static void main(String[] args) throws InterruptedException { // TODO Auto-generated method stub System.setProperty("webdriver.chrome.driver", "C:\\Work\\chromedriver.exe"); WebDriver driver = new ChromeDriver();

No comments:

Post a Comment