Skip to content

unable to read otp from extension connection page after chrome update to 136 #1483

Open
@TestUser77771

Description

@TestUser77771

After updating Chrome to version 136+, my Selenium automation is no longer able to read or interact with an internal extension page used for browser authentication (chrome-extension://...). This breaks my OTP-based extension login workflow which was working fine before Chrome v136.

public void unlockEnpass() throws Exception {
    if (!isWebsiteelementpresent.isWebsiteElementPresent(browserRedirection.getUsernameBy())) {
        GenericMethods.scrollToElementBrowser(browserDriver, browserRedirection.getUsernameBy());
    }

    GenericMethods.switchFocusToInlinemenu(browserDriver, browserRedirection.getUsernameBy(), 3, 1000);

    if (inlineMenuScreen.isInlineMenuLocked()) {
        System.out.println("Unlock inline menu");
        inlineMenuScreen.clickInlineMenuLockScreen();
        Thread.sleep(1000);
        GenericMethods.switchFocusToExtension(driver);

        if (iwindowsLoginScreen.unlockButtonVisible()) {
            iwindowsLoginScreen.unlockEnpass(password);
            commonElementsScreen.waitForLoading();
        }
    }

    setupBrowserConnectionSteps.setupMainHelperWindow();
}

public void setupMainHelperWindow() throws Exception {
    if (!extensionMainScreen.isExtensionAuthenticated()) {
        int attemptCount = 0;
        int maxAttempts = 3;

        while (authenticateBrowser.isAuthenticateBrowserVisible() && attemptCount < maxAttempts) {
            System.out.println("Authentication required - Attempt " + (attemptCount + 1));

            GenericMethods.hitEnter(driver);

            try {
                authenticateBrowser.enterOTPToAutenticatBrowser();
            } catch (Exception e) {
                System.out.println("An error occurred while entering the OTP: " + e.getMessage());
                e.printStackTrace();
            }

            GenericMethods.openExtension(driver);

            attemptCount++;
        }

        if (authenticateBrowser.isAuthenticateBrowserVisible()) {
            System.out.println("Authentication failed after " + maxAttempts + " attempts.");
        } else {
            System.out.println("Extension successfully authenticated!");
        }
    }
}

public void enterOTPToAutenticatBrowser() throws InterruptedException, AWTException {
    otp = getOTPToAutenticatBrowser(); // reads OTP from extension page
    System.out.println(otp);
    GenericMethods.switchFocusToExtension(driver);
    sendKeys(driver, otpFieldBy(), otp);
    hitEsc(driver);
}

After upgrading to Chrome v136 or v137:

Extension is loaded via --load-extension=, but Selenium cannot access chrome-extension:// pages.

getOTPToAutenticatBrowser() fails silently or returns nothing.

Even if downgraded, Chrome auto-updates again and breaks the setup.

Likely a security change or policy enforcement in Chrome v136+ (related to extension isolation or restricting programmatic access to chrome-extension:// pages).

Is there a workaround, setting, or browser flag needed now?

Would appreciate any insight or guidance

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions