Skip to main content

Difference Between close() and quit() in Selenium Web Driver

In Selenium Web Driver both are use to close the browser by using script but both have different meaning in terms of use. we need to understand both because we need to use both of them in different time to execution of Test Cases.

driver.quit() is used to closed all the browser session which generated by the web driver. while driver.close() just closed the browser session on which Selenium Web Driver focusing that time.

You should use driver.quit() when you want to close your program because if you didn't close it then file will not release your memory because of that you can stuck in memory leak problem.

driver.close() and driver.quit() work in same way when Selenium Web Driver open only single window but if Selenium Web Driver open multiple windows then both behave differently.

Comments

Popular posts from this blog

What is API?

In general way, API (Application Programming Interface) is the intermediate software which is useful for two applications to communicate. API is the tool which is used for interaction of two applications. If developer developing any software which have multiple blocks (Modules) than developer use APIs to put them together.

Structural Testing

Structural Testing is the type of testing in which user should have the knowledge of the code because in this testing user need to check the structure of the system. Structural Testing is White Box Testing.