diff --git a/roadtx/roadtools/roadtx/selenium.py b/roadtx/roadtools/roadtx/selenium.py index ed89e49..876d8b8 100644 --- a/roadtx/roadtools/roadtx/selenium.py +++ b/roadtx/roadtools/roadtx/selenium.py @@ -295,6 +295,15 @@ def selenium_login(self, url, identity=None, password=None, otpseed=None, keep=F els = WebDriverWait(driver, 6000).until(lambda d: d.find_element(By.ID, "i0118")) els.send_keys(Keys.ENTER) + # In case "Are you trying to sign in to MS authentication broker" page is shown immediately, click continue + try: + els = WebDriverWait(driver, 1).until(lambda d: d.find_element(By.ID, "idSIButton9")) + # Prevents attempting to click on disabled button, e.g. if account selection page is shown + if els.get_attribute("style") != "display: none;": + els.click() + except TimeoutException: + pass + # Quick check of mfa not needed try: try: