How to close child browser window in Selenium WebDriver using Java

后端 未结 7 1628
傲寒
傲寒 2020-12-14 16:07

After I switch to a new window and complete the task, I want to close that new window and switch to the old window,

so here i written like code:

// P         


        
7条回答
  •  温柔的废话
    2020-12-14 16:57

    To close a single browser window:

    driver.close();
    

    To close all (parent+child) browser windows and end the whole session:

    driver.quit();
    

提交回复
热议问题