def get_alert_text(self):
        """
        Get text of the current alert and close it.
        :returns: alert text
        """
        alert = self.switch_to_alert()
        # Selenium can return either dict or text,
        # TODO: Need to investigate why
        try:
            text = alert.text['text']
        except __HOLE__:
            text = alert.text
        alert.dismiss()
        self.switch_to_default_content()
        self.update_text()
        return text
dataset/ETHPy150Open dragoon/django-selenium/django_selenium/testcases.py/MyDriver.get_alert_text