lundi 16 octobre 2017

Selenium Python - How to handle a random pop up?

For the past few months, I have been using Selenium to automate a very boring but essential part of my job which involves uploading forms.

Recently, the site has implemented a feed back survey which randomly pops up and switches the driver to a new frame. I have written the code which can handle this pop up and switch back to my default frame however the issue is with the randomness.

Is there a way to run my popup handling code as soon the exception generated by the wrong frame is thrown?

I could encase my whole script in a try and except block but how do I direct the script to pick back up from where it left off?

Any advice is much appreciated!




Aucun commentaire:

Enregistrer un commentaire