Skip to content

Disabling Chrome 127 Search Engine Choice Screen in Selenium Tests

Problem Statement

After Chrome's version 127 update, automated tests using Selenium WebDriver encounter failures due to a new mandatory "Select default search engine" prompt. This popup interrupts browser initialization and halts scripts since there's no default selection. The issue occurs because Chrome now requires manual search engine selection on first launch, breaking test automation flows that expect immediate browser readiness.

Solution

Add Chrome's --disable-search-engine-choice-screen startup argument through Selenium options to bypass the search engine prompt. This flag suppresses the mandatory selection screen while maintaining full test functionality.

Why this works:
The flag explicitly disables Chrome's search engine selection UX, allowing immediate browser initialization without manual intervention. This solution is officially recognized in Chromium's command-line switches.

Compatibility Note

Verify your ChromeDriver version matches Chrome browser version 127+ (e.g., ChromeDriver 127.0.6533.72)

Implementation Examples

Python Solution

python
from selenium import webdriver
from selenium.webdriver.chrome.options import Options

chrome_options = Options()
chrome_options.add_argument("--disable-search-engine-choice-screen")  # Disables prompt

driver = webdriver.Chrome(options=chrome_options)
# Browser now launches without search engine selection screen

Java Solution

java
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.chrome.ChromeOptions;

public class ChromeTest {
    public static void main(String[] args) {
        ChromeOptions options = new ChromeOptions();
        options.addArguments("--disable-search-engine-choice-screen");
        
        WebDriver driver = new ChromeDriver(options);
        // Browser launches without interruption
    }
}

WebdriverIO/Protractor Configuration

javascript
// In wdio.conf.js or protractor.conf.js
capabilities: [{
    browserName: 'chrome',
    'goog:chromeOptions': {
        args: [
            '--disable-search-engine-choice-screen'  // Add to Chrome arguments
        ]
    }
}]

Additional Considerations

  1. Flag Persistence: The flag only affects fresh browser profiles. Existing profiles with saved preferences won't trigger the prompt.
  2. Enterprise Scaling: For Dockerized tests or cloud grids, this flag must be included in all Chrome startup configurations.
  3. Alternative Approaches (Not Recommended):
    • Creating pre-configured Chrome profiles (more complex and error-prone)
    • Using robot library clicks to select engine (fragile and slow)

Best Practice

Combine this solution with explicit WebDriverWait conditions after initialization to ensure all page components fully load:

python
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC

# After driver initialization...
wait = WebDriverWait(driver, 10)
wait.until(EC.presence_of_element_located((By.TAG_NAME, "body")))

Post-Validation Checklist

  • [ ] Chrome & ChromeDriver versions match (≥127)
  • [ ] ChromeOptions added before driver initialization
  • [ ] Test runs without manual intervention prompts
  • [ ] No regressions in core test functionality

This solution provides a clean, maintainable fix that aligns with Chrome's design for automated testing environments. Implement the configuration change once at the driver initialization level to resolve failures across all test cases.