Selenium / Quiz

Session Configuration in Selenium 4

Build a browser session with typed Options, W3C capabilities, vendor preferences, and a separate input-action sequence.

Difficulty
Medium
Format
Quiz
Points
150
Estimate
8 min

// MISSION BRIEF

Your Mission

Browser startup settings and in-page user actions are different layers. Audit a Selenium 4 Java factory, identify which values become session capabilities, and keep browser-specific preferences out of test interaction code.

// FIRST CONTACT

Battle teaser

Which Selenium 4 Java construction correctly starts headless Chrome with a fixed window size?

  1. AWebDriver driver = new ChromeDriver(true, 1440, 900);
  2. BDesiredCapabilities.chrome().setHeadless(true); WebDriver driver = new ChromeDriver();
  3. CChromeOptions options = new ChromeOptions(); options.addArguments("--headless=new", "--window-size=1440,900"); WebDriver driver = new ChromeDriver(options);
  4. DWebDriver driver = ChromeDriver.startWithCapabilitiesXml("chrome.xml");
Answers, scoring, hints, and the full battle stay sealed.

// SKILL TAGS

selenium-optionscapabilitiesactionsselenium