I have a python selenium script which loads the Google chrome driver and then does some automation of an URL. Here is how I load the driver in my script:
try:
self.driver = webdriver.Chrome(options=options, executable_path=self.path)
except Exception as err:
print(str(err))
else:
print("Chrome driver Launched")
self.Login_url()
'''Login_url() and other functions defined below...
But when the code is in the try block (i.e the chrome driver is still loading), I get a number of windows message boxes pop up, like the image below :
Only when I manually click "Ok" on all the message boxes, the control reaches the else part in my code, prints "Chrome driver Launched"
and then moves further.
Hence I want to do this:
Write a python function in my script to first identify if the windows msgbox has popped up (this is important as the above message boxes don't popup every time I run my script). If the pop up is identified, then click ok.
How can this be handled in below options (preference of answers is in exact order)
- Selenium itself by adding some webdriver preferences/options ?
- Using python's default
tkinter
package for Windows GUI automation ? - Using python's
pywinauto
package for GUI automation ?
Please help.