查了一下網上的webdreiver 的 api,才發現,
quit()詳細信息: “Quits this driver, closing every associated window”,執行這個方法後,driver會關閉所有關聯窗口。
close()詳細信息:Close the current window, quitting the browser if it's the last window currently open ,此方法是關閉當前窗口,或最後打開的窗口。
1. webDriver.Close()
- Close the browser window that the driver has focus of //關閉當前焦點所在的窗口
2. webDriver.Quit()
- Calls dispose //調用dispose方法
3. webDriver.Dispose()
Closes all browser windows and safely ends the session 關閉所有窗口,並且安全關閉session