'Alert re-try for Chrome
Because Chrome has difficulties to handle alerts, like::
alert.text
alert.dismiss
This function creates a re-try functionality to better support
alerts in Chrome.'

def _handle_alert(self, dismiss_type=None):

    retry = 0
    while (retry < 4):
        try:
            return self._alert_worker(dismiss_type)
        except WebDriverException:
            time.sleep(0.2)
            retry += 1
    raise RuntimeError('There    were    no    alerts')
