Home > other >  How to close all Windows after selenium open chrome
How to close all Windows after selenium open chrome

Time:11-17

Using selenium open a chrome window, then automatic operation,
In this process, there are some ads or other comments window pop up automatically,
After completion of the operation, then, how to put these programs automatically open, and site automatically pop up all the Windows closed?

CodePudding user response:

Driver. The quit ()
This operation can exit the browser,

CodePudding user response:

For your reference
@ classmethod
Def tearDownClass (CLS) :
- close the browser "" "" logged on ""
CLS. Driver. Switch_to. Default_content ()
CLS. Driver. Find_element_by_id (" exitBtn "). Click click exit () #
CLS. Driver. The quit ()
  • Related