Q1.Explain the difference between driver.close() and driver.quit().
driver.close() closes only the current active browser tab or window where WebDriver currently has focus, leaving the underlying browser driver session active if other windows remain open. In contrast, driver.quit() closes every open browser window, terminates the native browser process, and completely destroys the WebDriver session on the OS. Forgetting to call driver.quit() in teardown hooks causes zombie chromedriver processes to accumulate on CI/CD runner nodes, exhausting server memory.
driver.quit(); // Closes all windows and terminates session safely