Bird
Raised Fist0
Selenium Pythontesting~20 mins

Headless browser execution in Selenium Python - Practice Problems & Coding Challenges

Choose your learning style10 modes available
Challenge - 5 Problems
🎖️
Headless Browser Mastery
Get all challenges correct to earn this badge!
Test your skills under time pressure!
❓ Predict Output
intermediate
2:00remaining
What is the output of this Selenium headless browser code?
Consider the following Python Selenium code snippet that runs a headless Chrome browser and fetches the page title. What will be printed?
Selenium Python
from selenium import webdriver
from selenium.webdriver.chrome.options import Options

options = Options()
options.add_argument('--headless')
driver = webdriver.Chrome(options=options)
driver.get('https://example.com')
print(driver.title)
driver.quit()
AExample Domain
Bhttps://example.com
Cselenium.common.exceptions.WebDriverException
D'' (empty string)
Attempts:
2 left
💡 Hint
The page title is the text inside the tag of the loaded page.</div></div><div class="feedback-box incorrect d-none"><div class="feedback-title">✗ Incorrect</div><div class="feedback-text">The code opens https://example.com in a headless Chrome browser and prints the page title, which is 'Example Domain'.</div></div></div></div><div class="challenge-container "><div class="task-card "><div class="task-header"><div class="task-badge"><span class="challenge-type-badge assertion">❓<!-- --> <!-- -->assertion</span></div><span class="task-difficulty intermediate">intermediate</span></div><div class="challenge-timer "><svg class="timer-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><circle cx="12" cy="12" r="10"></circle><polyline points="12 6 12 12 16 14"></polyline></svg><span class="timer-value">2:00</span><span class="timer-label">remaining</span></div><div class="challenge-prompt"><div class="challenge-title">Which assertion correctly verifies the page title in headless mode?</div><div>You want to assert that the page title is exactly 'Welcome Page' after loading a page in headless mode. Which assertion is correct?</div></div><div class="mt-3 "><div class="code-block"><div class="code-header"><span class="code-title">Selenium Python</span><button class="code-copy-btn"><span class="new-material-symbols icon-hw-16"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -960 960 960"><path d="M326.93-211.18q-30.99 0-53.37-22.38t-22.38-53.37v-528.56q0-31.06 22.38-53.48 22.38-22.43 53.37-22.43h408.56q31.06 0 53.48 22.43 22.43 22.42 22.43 53.48v528.56q0 30.99-22.43 53.37-22.42 22.38-53.48 22.38H326.93Zm0-75.75h408.56v-528.56H326.93v528.56ZM184.51-68.6q-31.06 0-53.48-22.43-22.43-22.42-22.43-53.48v-566.43q0-16 10.97-26.94 10.98-10.94 27.1-10.94 16.13 0 26.99 10.94 10.85 10.94 10.85 26.94v566.43h446.43q16 0 26.94 10.97 10.94 10.97 10.94 27.1 0 16.13-10.94 26.98-10.94 10.86-26.94 10.86H184.51Zm142.42-218.33v-528.56 528.56Z"></path></svg></span></button></div><pre class="code-content"><span class="hl-kw">from</span> selenium <span class="hl-kw">import</span> webdriver <span class="hl-kw">from</span> selenium.webdriver.chrome.options <span class="hl-kw">import</span> Options options = Options() options.add_argument(<span class="hl-str">'--headless'</span>) driver = webdriver.Chrome(options=options) driver.get(<span class="hl-str">'https://example.com/welcome'</span>) <span class="hl-cmt"># Which assertion below is correct?</span> </pre></div></div><div class="task-options"><div class="task-option "><span class="task-option-key">A</span><span class="text-pre-wrap">assert 'Welcome Page' in driver.title()</span></div><div class="task-option "><span class="task-option-key">B</span><span class="text-pre-wrap">assert driver.title.contains('Welcome Page')</span></div><div class="task-option "><span class="task-option-key">C</span><span class="text-pre-wrap">assert driver.title == 'Welcome Page'</span></div><div class="task-option "><span class="task-option-key">D</span><span class="text-pre-wrap">assert driver.title.equals('Welcome Page')</span></div></div><div class="challenge-attempts"><span>Attempts:</span><div class="attempt-dots"><span class="attempt-dot "></span><span class="attempt-dot "></span></div><span>2<!-- --> left</span></div><div class="challenge-hint d-none"><div class="challenge-hint-title">💡 Hint</div><div class="challenge-hint-text">Check the correct Python syntax for string equality and attribute access.</div></div><div class="feedback-box incorrect d-none"><div class="feedback-title">✗ Incorrect</div><div class="feedback-text">The page title is accessed as a string attribute driver.title. The correct way to assert equality is 'assert driver.title == "Welcome Page"'.</div></div></div></div><div class="challenge-container "><div class="task-card "><div class="task-header"><div class="task-badge"><span class="challenge-type-badge debug">🔧<!-- --> <!-- -->Debug</span></div><span class="task-difficulty advanced">advanced</span></div><div class="challenge-timer "><svg class="timer-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><circle cx="12" cy="12" r="10"></circle><polyline points="12 6 12 12 16 14"></polyline></svg><span class="timer-value">2:30</span><span class="timer-label">remaining</span></div><div class="challenge-prompt"><div class="challenge-title">Why does this headless browser test fail to find the element?</div><div>This Selenium test runs in headless mode but fails to find the element with id 'submit-btn'. What is the likely cause?</div></div><div class="mt-3 "><div class="code-block"><div class="code-header"><span class="code-title">Selenium Python</span><button class="code-copy-btn"><span class="new-material-symbols icon-hw-16"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -960 960 960"><path d="M326.93-211.18q-30.99 0-53.37-22.38t-22.38-53.37v-528.56q0-31.06 22.38-53.48 22.38-22.43 53.37-22.43h408.56q31.06 0 53.48 22.43 22.43 22.42 22.43 53.48v528.56q0 30.99-22.43 53.37-22.42 22.38-53.48 22.38H326.93Zm0-75.75h408.56v-528.56H326.93v528.56ZM184.51-68.6q-31.06 0-53.48-22.43-22.43-22.42-22.43-53.48v-566.43q0-16 10.97-26.94 10.98-10.94 27.1-10.94 16.13 0 26.99 10.94 10.85 10.94 10.85 26.94v566.43h446.43q16 0 26.94 10.97 10.94 10.97 10.94 27.1 0 16.13-10.94 26.98-10.94 10.86-26.94 10.86H184.51Zm142.42-218.33v-528.56 528.56Z"></path></svg></span></button></div><pre class="code-content"><span class="hl-kw">from</span> selenium <span class="hl-kw">import</span> webdriver <span class="hl-kw">from</span> selenium.webdriver.chrome.options <span class="hl-kw">import</span> Options <span class="hl-kw">from</span> selenium.webdriver.common.by <span class="hl-kw">import</span> By options = Options() options.add_argument(<span class="hl-str">'--headless'</span>) driver = webdriver.Chrome(options=options) driver.get(<span class="hl-str">'https://example.com/form'</span>) submit_button = driver.find_element(By.ID, <span class="hl-str">'submit-btn'</span>) submit_button.click() driver.quit()</pre></div></div><div class="task-options"><div class="task-option "><span class="task-option-key">A</span><span class="text-pre-wrap">Headless mode disables JavaScript, so the element is not rendered.</span></div><div class="task-option "><span class="task-option-key">B</span><span class="text-pre-wrap">The element is inside an iframe and needs switching to the iframe first.</span></div><div class="task-option "><span class="task-option-key">C</span><span class="text-pre-wrap">The element ID is misspelled in the locator.</span></div><div class="task-option "><span class="task-option-key">D</span><span class="text-pre-wrap">The page URL is incorrect and returns 404.</span></div></div><div class="challenge-attempts"><span>Attempts:</span><div class="attempt-dots"><span class="attempt-dot "></span><span class="attempt-dot "></span></div><span>2<!-- --> left</span></div><div class="challenge-hint d-none"><div class="challenge-hint-title">💡 Hint</div><div class="challenge-hint-text">Check if the element is inside a frame or iframe that requires switching context.</div></div><div class="feedback-box incorrect d-none"><div class="feedback-title">✗ Incorrect</div><div class="feedback-text">In headless mode, the page renders normally including iframes. If the element is inside an iframe, Selenium must switch to that iframe before locating the element.</div></div></div></div><div class="challenge-container "><div class="task-card "><div class="task-header"><div class="task-badge"><span class="challenge-type-badge framework">❓<!-- --> <!-- -->framework</span></div><span class="task-difficulty advanced">advanced</span></div><div class="challenge-timer "><svg class="timer-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><circle cx="12" cy="12" r="10"></circle><polyline points="12 6 12 12 16 14"></polyline></svg><span class="timer-value">2:30</span><span class="timer-label">remaining</span></div><div class="challenge-prompt"><div class="challenge-title">Which setup correctly initializes a headless Firefox browser in pytest fixture?</div><div>You want to create a pytest fixture that provides a headless Firefox WebDriver instance. Which code snippet is correct?</div></div><div class="mt-3 d-none"></div><div class="task-options"><div class="task-option task-option-code "><span class="task-option-key">A</span><pre class="option-code">import pytest from selenium import webdriver from selenium.webdriver.firefox.options import Options @pytest.fixture def driver(): options = Options() driver = webdriver.Firefox() yield driver driver.quit()</pre></div><div class="task-option task-option-code "><span class="task-option-key">B</span><pre class="option-code">import pytest from selenium import webdriver from selenium.webdriver.firefox.options import Options @pytest.fixture def driver(): options = Options() options.add_argument('--headless') driver = webdriver.Firefox(options=options) yield driver driver.close()</pre></div><div class="task-option task-option-code "><span class="task-option-key">C</span><pre class="option-code">import pytest from selenium import webdriver from selenium.webdriver.firefox.options import Options @pytest.fixture def driver(): options = Options() options.headless = False driver = webdriver.Firefox(options=options) yield driver driver.quit()</pre></div><div class="task-option task-option-code "><span class="task-option-key">D</span><pre class="option-code">import pytest from selenium import webdriver from selenium.webdriver.firefox.options import Options @pytest.fixture def driver(): options = Options() options.headless = True driver = webdriver.Firefox(options=options) yield driver driver.quit()</pre></div></div><div class="challenge-attempts"><span>Attempts:</span><div class="attempt-dots"><span class="attempt-dot "></span><span class="attempt-dot "></span></div><span>2<!-- --> left</span></div><div class="challenge-hint d-none"><div class="challenge-hint-title">💡 Hint</div><div class="challenge-hint-text">Check how to set headless mode for Firefox using the Options class.</div></div><div class="feedback-box incorrect d-none"><div class="feedback-title">✗ Incorrect</div><div class="feedback-text">For Firefox, setting options.headless = True enables headless mode. Using options.add_argument('--headless') is not correct for Firefox. driver.quit() properly closes the browser.</div></div></div></div><div class="challenge-container "><div class="task-card "><div class="task-header"><div class="task-badge"><span class="challenge-type-badge conceptual">🧠<!-- --> <!-- -->Conceptual</span></div><span class="task-difficulty expert">expert</span></div><div class="challenge-timer "><svg class="timer-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><circle cx="12" cy="12" r="10"></circle><polyline points="12 6 12 12 16 14"></polyline></svg><span class="timer-value">3:00</span><span class="timer-label">remaining</span></div><div class="challenge-prompt"><div class="challenge-title">What is a key limitation of headless browser testing compared to headed mode?</div><div>Which of the following is a common limitation when running tests in headless browser mode compared to headed (normal) mode?</div></div><div class="mt-3 d-none"></div><div class="task-options"><div class="task-option "><span class="task-option-key">A</span><span class="text-pre-wrap">Some visual rendering issues or animations may not behave exactly the same, causing false negatives.</span></div><div class="task-option "><span class="task-option-key">B</span><span class="text-pre-wrap">Headless mode always runs slower than headed mode due to lack of GPU acceleration.</span></div><div class="task-option "><span class="task-option-key">C</span><span class="text-pre-wrap">Headless browsers cannot execute JavaScript, so dynamic pages fail to load.</span></div><div class="task-option "><span class="task-option-key">D</span><span class="text-pre-wrap">Headless mode disables network requests, so pages do not load any resources.</span></div></div><div class="challenge-attempts"><span>Attempts:</span><div class="attempt-dots"><span class="attempt-dot "></span><span class="attempt-dot "></span></div><span>2<!-- --> left</span></div><div class="challenge-hint d-none"><div class="challenge-hint-title">💡 Hint</div><div class="challenge-hint-text">Think about differences in rendering and user interface behavior between headless and headed browsers.</div></div><div class="feedback-box incorrect d-none"><div class="feedback-title">✗ Incorrect</div><div class="feedback-text">Headless browsers may render pages slightly differently, especially with animations or complex CSS, which can cause tests to fail even if the headed browser works fine.</div></div></div></div></div></article><div class="confetti-container"></div></div><div><article class="content-card" id="practice"><div class="code-articles-card-header justify-content-between"><div class="d-flex align-items-center" style="gap:12px"><span class="card-icon nofill intro"><svg stroke="currentColor" fill="none" stroke-width="2" viewBox="0 0 24 24" stroke-linecap="round" stroke-linejoin="round" class="blue-icon-color site-fs-20" height="1em" width="1em" xmlns="http://www.w3.org/2000/svg"><path d="M12 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"></path><path d="M12 7a5 5 0 1 0 5 5"></path><path d="M13 3.055a9 9 0 1 0 7.941 7.945"></path><path d="M15 6v3h3l3 -3h-3v-3z"></path><path d="M15 9l-3 3"></path></svg></span><h2 class="codefly-card-title mb-0 pb-0">Practice</h2></div><span class="site-fs-15">(<!-- -->1<!-- -->/<!-- -->5<!-- -->)</span></div><div class="code-articles-card-body" data-theme="light"><div class=""><div class="mb-4"><div class="practice-content"><div class="text-pre-wrap dbd-txt-theme-intense pb-3">1<!-- -->. <!-- -->What is the main advantage of running Selenium tests in headless mode?</div></div><div class="question-pills-container " style="padding-top:unset"><span class="level-badge">easy</span></div></div><div class=""><div class="practice-options"><div class="practice-option-label" style="cursor:pointer"><svg stroke="currentColor" fill="currentColor" stroke-width="0" viewBox="0 0 24 24" class="txt-dark-grey-color site-fs-18 me-2 me-md-3" height="1em" width="1em" xmlns="http://www.w3.org/2000/svg"><path fill="none" d="M0 0h24v24H0z"></path><path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"></path></svg><span>A<!-- -->. <!-- -->It requires more system resources than normal mode</span></div><div class="practice-option-label" style="cursor:pointer"><svg stroke="currentColor" fill="currentColor" stroke-width="0" viewBox="0 0 24 24" class="txt-dark-grey-color site-fs-18 me-2 me-md-3" height="1em" width="1em" xmlns="http://www.w3.org/2000/svg"><path fill="none" d="M0 0h24v24H0z"></path><path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"></path></svg><span>B<!-- -->. <!-- -->It allows manual interaction with the browser during tests</span></div><div class="practice-option-label" style="cursor:pointer"><svg stroke="currentColor" fill="currentColor" stroke-width="0" viewBox="0 0 24 24" class="txt-dark-grey-color site-fs-18 me-2 me-md-3" height="1em" width="1em" xmlns="http://www.w3.org/2000/svg"><path fill="none" d="M0 0h24v24H0z"></path><path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"></path></svg><span>C<!-- -->. <!-- -->Tests run faster without opening a visible browser window</span></div><div class="practice-option-label" style="cursor:pointer"><svg stroke="currentColor" fill="currentColor" stroke-width="0" viewBox="0 0 24 24" class="txt-dark-grey-color site-fs-18 me-2 me-md-3" height="1em" width="1em" xmlns="http://www.w3.org/2000/svg"><path fill="none" d="M0 0h24v24H0z"></path><path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"></path></svg><span>D<!-- -->. <!-- -->It disables all JavaScript on the web page</span></div></div><div class="py-3"><button class="site-btn" style="width:200px" disabled="">Verify</button></div></div><div class="py-2 d-none"><div class="practice-helper-btns-wrapper"></div><div class="practice-expanation-div "><div class="practice-expanation-div-body"><div class="practice-helper-content helper-solution-box"><h4 class="helper-solution-box-title">Solution</h4><div class="practice-helper-body"><ol><li><h4>Step 1: Understand headless mode purpose</h4>Headless mode runs browser tests without showing the browser window, saving time and resources.</li><li><h4>Step 2: Compare options</h4>Only Tests run faster without opening a visible browser window correctly states that tests run faster without opening a visible window. Other options are incorrect or unrelated.</li><li><h4>Final Answer:</h4><strong>Tests run faster without opening a visible browser window</strong> -> Option C</li><li><h4>Quick Check:</h4>Headless mode = faster tests without UI [OK]</li></ol></div></div></div></div><div class="practice-expanation-div "><div class="practice-expanation-div-body"><div class="practice-helper-content helper-hint-box"><div class="practice-helper-body"><strong class="helper-hint-box-title">Hint: </strong>Headless means no browser window visible during tests [OK]</div></div></div></div><div class="practice-expanation-div "><div class="practice-expanation-div-body"><div class="practice-helper-content helper-mistakes-box"><div class="practice-helper-body"><strong class="helper-mistakes-box-title">Common Mistakes: </strong><ul class="ph-mistakes-list"><li class="ph-mistake-item mb-0">Thinking headless disables JavaScript</li><li class="ph-mistake-item mb-0">Assuming headless mode allows manual browser control</li><li class="ph-mistake-item mb-0">Believing headless uses more resources</li></ul></div></div></div></div></div></div><div class="d-none"><div class="mb-4"><div class="practice-content"><div class="text-pre-wrap dbd-txt-theme-intense pb-3">2<!-- -->. <!-- -->Which of the following is the correct way to enable headless mode in Selenium with Python using Chrome?</div></div><div class="question-pills-container " style="padding-top:unset"><span class="level-badge">easy</span></div></div><div class=""><div class="practice-options"><div class="practice-option-label" style="cursor:pointer"><svg stroke="currentColor" fill="currentColor" stroke-width="0" viewBox="0 0 24 24" class="txt-dark-grey-color site-fs-18 me-2 me-md-3" height="1em" width="1em" xmlns="http://www.w3.org/2000/svg"><path fill="none" d="M0 0h24v24H0z"></path><path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"></path></svg><span>A<!-- -->. <!-- -->options = webdriver.ChromeOptions() options.add_argument('--headless') driver = webdriver.Chrome(options=options)</span></div><div class="practice-option-label" style="cursor:pointer"><svg stroke="currentColor" fill="currentColor" stroke-width="0" viewBox="0 0 24 24" class="txt-dark-grey-color site-fs-18 me-2 me-md-3" height="1em" width="1em" xmlns="http://www.w3.org/2000/svg"><path fill="none" d="M0 0h24v24H0z"></path><path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"></path></svg><span>B<!-- -->. <!-- -->driver = webdriver.Chrome(headless=True)</span></div><div class="practice-option-label" style="cursor:pointer"><svg stroke="currentColor" fill="currentColor" stroke-width="0" viewBox="0 0 24 24" class="txt-dark-grey-color site-fs-18 me-2 me-md-3" height="1em" width="1em" xmlns="http://www.w3.org/2000/svg"><path fill="none" d="M0 0h24v24H0z"></path><path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"></path></svg><span>C<!-- -->. <!-- -->options = webdriver.ChromeOptions() options.headless = True driver = webdriver.Chrome(options=options)</span></div><div class="practice-option-label" style="cursor:pointer"><svg stroke="currentColor" fill="currentColor" stroke-width="0" viewBox="0 0 24 24" class="txt-dark-grey-color site-fs-18 me-2 me-md-3" height="1em" width="1em" xmlns="http://www.w3.org/2000/svg"><path fill="none" d="M0 0h24v24H0z"></path><path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"></path></svg><span>D<!-- -->. <!-- -->driver = webdriver.Chrome() driver.set_headless(True)</span></div></div><div class="py-3"><button class="site-btn" style="width:200px" disabled="">Verify</button></div></div><div class="py-2 d-none"><div class="practice-helper-btns-wrapper"></div><div class="practice-expanation-div "><div class="practice-expanation-div-body"><div class="practice-helper-content helper-solution-box"><h4 class="helper-solution-box-title">Solution</h4><div class="practice-helper-body"><ol><li><h4>Step 1: Review Selenium headless syntax</h4>To enable headless mode, you add the '--headless' argument to ChromeOptions and pass it to the driver.</li><li><h4>Step 2: Analyze options</h4>options = webdriver.ChromeOptions() options.add_argument('--headless') driver = webdriver.Chrome(options=options) correctly uses options.add_argument('--headless') and passes options to Chrome. options = webdriver.ChromeOptions() options.headless = True driver = webdriver.Chrome(options=options) incorrectly sets options.headless (not standard). Options B and D use invalid syntax.</li><li><h4>Final Answer:</h4><strong>options = webdriver.ChromeOptions() options.add_argument('--headless') driver = webdriver.Chrome(options=options)</strong> -> Option A</li><li><h4>Quick Check:</h4>Use add_argument('--headless') to enable headless [OK]</li></ol></div></div></div></div><div class="practice-expanation-div "><div class="practice-expanation-div-body"><div class="practice-helper-content helper-hint-box"><div class="practice-helper-body"><strong class="helper-hint-box-title">Hint: </strong>Use add_argument('--headless') on ChromeOptions [OK]</div></div></div></div><div class="practice-expanation-div "><div class="practice-expanation-div-body"><div class="practice-helper-content helper-mistakes-box"><div class="practice-helper-body"><strong class="helper-mistakes-box-title">Common Mistakes: </strong><ul class="ph-mistakes-list"><li class="ph-mistake-item mb-0">Setting options.headless = True (not standard)</li><li class="ph-mistake-item mb-0">Passing headless=True directly to webdriver.Chrome()</li><li class="ph-mistake-item mb-0">Calling non-existent set_headless method</li></ul></div></div></div></div></div></div><div class="d-none"><div class="mb-4"><div class="practice-content"><div class="text-pre-wrap dbd-txt-theme-intense pb-3">3<!-- -->. <!-- -->What will be the output of the following code snippet? <pre>from selenium import webdriver options = webdriver.ChromeOptions() options.add_argument('--headless') driver = webdriver.Chrome(options=options) driver.get('https://example.com') print(driver.title) driver.quit()</pre></div></div><div class="question-pills-container " style="padding-top:unset"><span class="level-badge">medium</span></div></div><div class=""><div class="practice-options"><div class="practice-option-label" style="cursor:pointer"><svg stroke="currentColor" fill="currentColor" stroke-width="0" viewBox="0 0 24 24" class="txt-dark-grey-color site-fs-18 me-2 me-md-3" height="1em" width="1em" xmlns="http://www.w3.org/2000/svg"><path fill="none" d="M0 0h24v24H0z"></path><path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"></path></svg><span>A<!-- -->. <!-- -->Opens a visible browser window and prints the title</span></div><div class="practice-option-label" style="cursor:pointer"><svg stroke="currentColor" fill="currentColor" stroke-width="0" viewBox="0 0 24 24" class="txt-dark-grey-color site-fs-18 me-2 me-md-3" height="1em" width="1em" xmlns="http://www.w3.org/2000/svg"><path fill="none" d="M0 0h24v24H0z"></path><path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"></path></svg><span>B<!-- -->. <!-- -->Raises an error because headless mode cannot get page title</span></div><div class="practice-option-label" style="cursor:pointer"><svg stroke="currentColor" fill="currentColor" stroke-width="0" viewBox="0 0 24 24" class="txt-dark-grey-color site-fs-18 me-2 me-md-3" height="1em" width="1em" xmlns="http://www.w3.org/2000/svg"><path fill="none" d="M0 0h24v24H0z"></path><path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"></path></svg><span>C<!-- -->. <!-- -->Prints an empty string because page is not loaded in headless mode</span></div><div class="practice-option-label" style="cursor:pointer"><svg stroke="currentColor" fill="currentColor" stroke-width="0" viewBox="0 0 24 24" class="txt-dark-grey-color site-fs-18 me-2 me-md-3" height="1em" width="1em" xmlns="http://www.w3.org/2000/svg"><path fill="none" d="M0 0h24v24H0z"></path><path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"></path></svg><span>D<!-- -->. <!-- -->Prints the title of the page 'Example Domain' without opening a browser window</span></div></div><div class="py-3"><button class="site-btn" style="width:200px" disabled="">Verify</button></div></div><div class="py-2 d-none"><div class="practice-helper-btns-wrapper"></div><div class="practice-expanation-div "><div class="practice-expanation-div-body"><div class="practice-helper-content helper-solution-box"><h4 class="helper-solution-box-title">Solution</h4><div class="practice-helper-body"><ol><li><h4>Step 1: Understand headless execution effect</h4>Headless mode runs browser without UI but fully loads pages and executes scripts.</li><li><h4>Step 2: Analyze code behavior</h4>The code loads 'https://example.com' and prints the page title. Headless mode does not prevent getting the title, so it prints 'Example Domain'.</li><li><h4>Final Answer:</h4><strong>Prints the title of the page 'Example Domain' without opening a browser window</strong> -> Option D</li><li><h4>Quick Check:</h4>Headless loads page and gets title correctly [OK]</li></ol></div></div></div></div><div class="practice-expanation-div "><div class="practice-expanation-div-body"><div class="practice-helper-content helper-hint-box"><div class="practice-helper-body"><strong class="helper-hint-box-title">Hint: </strong>Headless runs full browser without UI, so title is accessible [OK]</div></div></div></div><div class="practice-expanation-div "><div class="practice-expanation-div-body"><div class="practice-helper-content helper-mistakes-box"><div class="practice-helper-body"><strong class="helper-mistakes-box-title">Common Mistakes: </strong><ul class="ph-mistakes-list"><li class="ph-mistake-item mb-0">Assuming headless mode blocks page loading</li><li class="ph-mistake-item mb-0">Expecting errors when accessing page title in headless</li><li class="ph-mistake-item mb-0">Thinking headless opens visible browser window</li></ul></div></div></div></div></div></div><div class="d-none"><div class="mb-4"><div class="practice-content"><div class="text-pre-wrap dbd-txt-theme-intense pb-3">4<!-- -->. <!-- -->You wrote this code to run Chrome in headless mode but the browser window still appears. What is the likely mistake? <pre>from selenium import webdriver options = webdriver.ChromeOptions() driver = webdriver.Chrome(options=options) options.add_argument('--headless') driver.get('https://example.com')</pre></div></div><div class="question-pills-container " style="padding-top:unset"><span class="level-badge">medium</span></div></div><div class=""><div class="practice-options"><div class="practice-option-label" style="cursor:pointer"><svg stroke="currentColor" fill="currentColor" stroke-width="0" viewBox="0 0 24 24" class="txt-dark-grey-color site-fs-18 me-2 me-md-3" height="1em" width="1em" xmlns="http://www.w3.org/2000/svg"><path fill="none" d="M0 0h24v24H0z"></path><path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"></path></svg><span>A<!-- -->. <!-- -->Headless mode is not supported on Chrome</span></div><div class="practice-option-label" style="cursor:pointer"><svg stroke="currentColor" fill="currentColor" stroke-width="0" viewBox="0 0 24 24" class="txt-dark-grey-color site-fs-18 me-2 me-md-3" height="1em" width="1em" xmlns="http://www.w3.org/2000/svg"><path fill="none" d="M0 0h24v24H0z"></path><path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"></path></svg><span>B<!-- -->. <!-- -->The headless argument was added after creating the driver, so it was ignored</span></div><div class="practice-option-label" style="cursor:pointer"><svg stroke="currentColor" fill="currentColor" stroke-width="0" viewBox="0 0 24 24" class="txt-dark-grey-color site-fs-18 me-2 me-md-3" height="1em" width="1em" xmlns="http://www.w3.org/2000/svg"><path fill="none" d="M0 0h24v24H0z"></path><path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"></path></svg><span>C<!-- -->. <!-- -->You must call driver.set_headless(True) after creating the driver</span></div><div class="practice-option-label" style="cursor:pointer"><svg stroke="currentColor" fill="currentColor" stroke-width="0" viewBox="0 0 24 24" class="txt-dark-grey-color site-fs-18 me-2 me-md-3" height="1em" width="1em" xmlns="http://www.w3.org/2000/svg"><path fill="none" d="M0 0h24v24H0z"></path><path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"></path></svg><span>D<!-- -->. <!-- -->You forgot to call driver.quit() to close the window</span></div></div><div class="py-3"><button class="site-btn" style="width:200px" disabled="">Verify</button></div></div><div class="py-2 d-none"><div class="practice-helper-btns-wrapper"></div><div class="practice-expanation-div "><div class="practice-expanation-div-body"><div class="practice-helper-content helper-solution-box"><h4 class="helper-solution-box-title">Solution</h4><div class="practice-helper-body"><ol><li><h4>Step 1: Check order of setting options</h4>The headless argument must be added to options before creating the driver instance.</li><li><h4>Step 2: Identify mistake in code</h4>Here, options.add_argument('--headless') is called after driver creation, so the driver does not run headless.</li><li><h4>Final Answer:</h4><strong>The headless argument was added after creating the driver, so it was ignored</strong> -> Option B</li><li><h4>Quick Check:</h4>Add headless argument before driver creation [OK]</li></ol></div></div></div></div><div class="practice-expanation-div "><div class="practice-expanation-div-body"><div class="practice-helper-content helper-hint-box"><div class="practice-helper-body"><strong class="helper-hint-box-title">Hint: </strong>Add headless option before creating driver instance [OK]</div></div></div></div><div class="practice-expanation-div "><div class="practice-expanation-div-body"><div class="practice-helper-content helper-mistakes-box"><div class="practice-helper-body"><strong class="helper-mistakes-box-title">Common Mistakes: </strong><ul class="ph-mistakes-list"><li class="ph-mistake-item mb-0">Adding headless argument after driver creation</li><li class="ph-mistake-item mb-0">Calling non-existent set_headless method</li><li class="ph-mistake-item mb-0">Assuming headless unsupported on Chrome</li></ul></div></div></div></div></div></div><div class="d-none"><div class="mb-4"><div class="practice-content"><div class="text-pre-wrap dbd-txt-theme-intense pb-3">5<!-- -->. <!-- -->You want to run Selenium tests in headless mode on a Linux server without a display. Which combination of steps is correct to ensure tests run smoothly?</div></div><div class="question-pills-container " style="padding-top:unset"><span class="level-badge">hard</span></div></div><div class=""><div class="practice-options"><div class="practice-option-label" style="cursor:pointer"><svg stroke="currentColor" fill="currentColor" stroke-width="0" viewBox="0 0 24 24" class="txt-dark-grey-color site-fs-18 me-2 me-md-3" height="1em" width="1em" xmlns="http://www.w3.org/2000/svg"><path fill="none" d="M0 0h24v24H0z"></path><path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"></path></svg><span>A<!-- -->. <!-- -->Use ChromeOptions with '--headless' argument and set '--no-sandbox' and '--disable-dev-shm-usage' arguments</span></div><div class="practice-option-label" style="cursor:pointer"><svg stroke="currentColor" fill="currentColor" stroke-width="0" viewBox="0 0 24 24" class="txt-dark-grey-color site-fs-18 me-2 me-md-3" height="1em" width="1em" xmlns="http://www.w3.org/2000/svg"><path fill="none" d="M0 0h24v24H0z"></path><path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"></path></svg><span>B<!-- -->. <!-- -->Use FirefoxOptions with '--headless' and run tests without any additional arguments</span></div><div class="practice-option-label" style="cursor:pointer"><svg stroke="currentColor" fill="currentColor" stroke-width="0" viewBox="0 0 24 24" class="txt-dark-grey-color site-fs-18 me-2 me-md-3" height="1em" width="1em" xmlns="http://www.w3.org/2000/svg"><path fill="none" d="M0 0h24v24H0z"></path><path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"></path></svg><span>C<!-- -->. <!-- -->Run Chrome without headless mode but use Xvfb to simulate display</span></div><div class="practice-option-label" style="cursor:pointer"><svg stroke="currentColor" fill="currentColor" stroke-width="0" viewBox="0 0 24 24" class="txt-dark-grey-color site-fs-18 me-2 me-md-3" height="1em" width="1em" xmlns="http://www.w3.org/2000/svg"><path fill="none" d="M0 0h24v24H0z"></path><path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"></path></svg><span>D<!-- -->. <!-- -->Use ChromeOptions with '--headless' only; no other arguments needed</span></div></div><div class="py-3"><button class="site-btn" style="width:200px" disabled="">Verify</button></div></div><div class="py-2 d-none"><div class="practice-helper-btns-wrapper"></div><div class="practice-expanation-div "><div class="practice-expanation-div-body"><div class="practice-helper-content helper-solution-box"><h4 class="helper-solution-box-title">Solution</h4><div class="practice-helper-body"><ol><li><h4>Step 1: Understand Linux server constraints</h4>Linux servers often lack GUI and have limited shared memory, so Chrome needs extra flags to run headless smoothly.</li><li><h4>Step 2: Identify required ChromeOptions</h4>Adding '--no-sandbox' and '--disable-dev-shm-usage' helps avoid permission and memory issues on Linux servers.</li><li><h4>Step 3: Evaluate options</h4>Use ChromeOptions with '--headless' argument and set '--no-sandbox' and '--disable-dev-shm-usage' arguments correctly includes these flags with '--headless'. Use FirefoxOptions with '--headless' and run tests without any additional arguments misses Linux-specific flags. Run Chrome without headless mode but use Xvfb to simulate display uses Xvfb but not headless mode. Use ChromeOptions with '--headless' only; no other arguments needed misses important flags.</li><li><h4>Final Answer:</h4><strong>Use ChromeOptions with '--headless' argument and set '--no-sandbox' and '--disable-dev-shm-usage' arguments</strong> -> Option A</li><li><h4>Quick Check:</h4>Linux headless Chrome needs extra flags for stability [OK]</li></ol></div></div></div></div><div class="practice-expanation-div "><div class="practice-expanation-div-body"><div class="practice-helper-content helper-hint-box"><div class="practice-helper-body"><strong class="helper-hint-box-title">Hint: </strong>Add '--no-sandbox' and '--disable-dev-shm-usage' on Linux [OK]</div></div></div></div><div class="practice-expanation-div "><div class="practice-expanation-div-body"><div class="practice-helper-content helper-mistakes-box"><div class="practice-helper-body"><strong class="helper-mistakes-box-title">Common Mistakes: </strong><ul class="ph-mistakes-list"><li class="ph-mistake-item mb-0">Using headless without Linux-specific flags</li><li class="ph-mistake-item mb-0">Assuming Firefox needs no extra setup</li><li class="ph-mistake-item mb-0">Relying on Xvfb instead of headless mode</li></ul></div></div></div></div></div></div><div class="d-flex align-items-center justify-content-between mt-4"><button class="secondary-site-btn" disabled=""><svg stroke="currentColor" fill="none" stroke-width="2" viewBox="0 0 24 24" aria-hidden="true" height="1em" width="1em" xmlns="http://www.w3.org/2000/svg"><path stroke-linecap="round" stroke-linejoin="round" d="M15 19l-7-7 7-7"></path></svg> Previous</button><div class="practice-question-toggles-wrapper"><button class="practice-question-toggle-btn active ">1</button><button class="practice-question-toggle-btn ">2</button><button class="practice-question-toggle-btn ">3</button><button class="practice-question-toggle-btn ">4</button><button class="practice-question-toggle-btn ">5</button></div><button class="secondary-site-btn">Next <svg stroke="currentColor" fill="none" stroke-width="2" viewBox="0 0 24 24" aria-hidden="true" height="1em" width="1em" xmlns="http://www.w3.org/2000/svg"><path stroke-linecap="round" stroke-linejoin="round" d="M9 5l7 7-7 7"></path></svg></button></div></div></article></div><div id="mock" class="mtc-wrapper"><div class="mtc-card-container"><div class="mtc-card pulse-effect"><span class="mtc-recommended-badge">Recommended</span><div class="mtc-icon-wrap"><svg stroke="currentColor" fill="none" stroke-width="2" viewBox="0 0 24 24" stroke-linecap="round" stroke-linejoin="round" color="#fff" style="color:#fff" height="24" width="24" xmlns="http://www.w3.org/2000/svg"><path d="M12 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"></path><path d="M12 7a5 5 0 1 0 5 5"></path><path d="M13 3.055a9 9 0 1 0 7.941 7.945"></path><path d="M15 6v3h3l3 -3h-3v-3z"></path><path d="M15 9l-3 3"></path></svg></div><h4 class="mtc-heading">Ready to prove it?</h4><p class="mtc-sub">Pass the test and this pattern moves <span class="mtc-state-pill">unknown</span> <svg stroke="currentColor" fill="currentColor" stroke-width="0" viewBox="0 0 512 512" height="1em" width="1em" xmlns="http://www.w3.org/2000/svg"><path fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="48" d="m268 112 144 144-144 144m124-144H100"></path></svg> <span class="mtc-state-pill good">strong</span> <span class="d-inline-block">while earning <span class="weight-800">+1 Grip</span></span> toward your certificate.</p><div class="mtc-pills"><span class="mtc-pill"><svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><line x1="8" y1="6" x2="21" y2="6"></line><line x1="8" y1="12" x2="21" y2="12"></line><line x1="8" y1="18" x2="21" y2="18"></line><line x1="3" y1="6" x2="3.01" y2="6"></line><line x1="3" y1="12" x2="3.01" y2="12"></line><line x1="3" y1="18" x2="3.01" y2="18"></line></svg>10 questions</span><span class="mtc-pill"><svg stroke="currentColor" fill="currentColor" stroke-width="0" viewBox="0 0 512 512" height="13" width="13" xmlns="http://www.w3.org/2000/svg"><path d="M256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zm0 448c-110.5 0-200-89.5-200-200S145.5 56 256 56s200 89.5 200 200-89.5 200-200 200zm61.8-104.4l-84.9-61.7c-3.1-2.3-4.9-5.9-4.9-9.7V116c0-6.6 5.4-12 12-12h32c6.6 0 12 5.4 12 12v141.7l66.8 48.6c5.4 3.9 6.5 11.4 2.6 16.8L334.6 349c-3.9 5.3-11.4 6.5-16.8 2.6z"></path></svg>~5 min</span><span class="mtc-pill"><svg width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><polyline points="22 12 18 12 15 21 9 3 6 12 2 12"></polyline></svg>easy <svg stroke="currentColor" fill="currentColor" stroke-width="0" viewBox="0 0 512 512" height="1em" width="1em" xmlns="http://www.w3.org/2000/svg"><path fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="48" d="m268 112 144 144-144 144m124-144H100"></path></svg> hard</span></div><div class="mtc-cta-wrap"><button type="button" class="mtc-cta-btn">Take the Test <svg stroke="currentColor" fill="currentColor" stroke-width="0" viewBox="0 0 512 512" height="1em" width="1em" xmlns="http://www.w3.org/2000/svg"><path fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="48" d="m268 112 144 144-144 144m124-144H100"></path></svg></button></div></div></div></div></div></main><div class="rpi-float-wrap"><button type="button" class="rpi-float-btn" aria-label="Report an issue"><svg stroke="currentColor" fill="none" stroke-width="2" viewBox="0 0 24 24" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" height="1em" width="1em" xmlns="http://www.w3.org/2000/svg"><path d="M4 15s1-1 4-1 5 2 8 2 4-1 4-1V3s-1 1-4 1-5-2-8-2-4 1-4 1z"></path><line x1="4" y1="22" x2="4" y2="15"></line></svg><span class="rpi-float-label">Report Issue</span></button></div></div><div style="display:none"><div id="ad-management-config-settings" data-blocklist-all="1"></div></div> <script src="/_next/static/chunks/webpack-28170116499ad51b.js" async=""></script><script>(self.__next_f=self.__next_f||[]).push([0]);self.__next_f.push([2,null])</script><script>self.__next_f.push([1,"1:HL[\"/_next/static/css/d071dca61fbb01bf.css\",\"style\"]\n2:HL[\"/_next/static/css/907864b6faf28c32.css\",\"style\"]\n3:HL[\"/_next/static/css/ada9a246b4e9c7f9.css\",\"style\"]\n4:HL[\"/_next/static/css/725c7861d1898ba8.css\",\"style\"]\n5:HL[\"/_next/static/css/a97525600f39e233.css\",\"style\"]\n6:HL[\"/_next/static/css/989afc350a4b3a28.css\",\"style\"]\n7:HL[\"/_next/static/css/ccfdf35169bd162c.css\",\"style\"]\n8:HL[\"/_next/static/css/417e7aee3e688b57.css\",\"style\"]\n"])</script><script>self.__next_f.push([1,"9:I[95751,[],\"\"]\nc:I[39275,[],\"\"]\n12:I[61343,[],\"\"]\n13:I[84080,[\"8726\",\"static/chunks/8726-fd60949e252ac8d1.js\",\"3185\",\"static/chunks/app/layout-e2ef1005801dc1ed.js\"],\"\"]\n14:I[88726,[\"8726\",\"static/chunks/8726-fd60949e252ac8d1.js\",\"3185\",\"static/chunks/app/layout-e2ef1005801dc1ed.js\"],\"Toaster\"]\n15:I[20154,[\"8422\",\"static/chunks/66ec4792-3d3220126f3e74ee.js\",\"6950\",\"static/chunks/f8025e75-5dd99dd1a689ea97.js\",\"6795\",\"static/chunks/6795-1b544390b9b7cb09.js\",\"5214\",\"static/chunks/5214-cc3a3a8017cc6e4d.js\",\"7078\",\"static/chunks/7078-09556dce22020d83.js\",\"3154\",\"static/chunks/3154-0aa2f15561902c10.js\",\"7562\",\"static/chunks/7562-b71a43604fd32292.js\",\"4481\",\"static/chunks/4481-14671e1e3d1ffff7.js\",\"4662\",\"static/chunks/4662-205abea99f9b3adf.js\",\"9160\",\"static/chunks/app/not-found-b9aad74520590312.js\"],\"default\"]\n16:I[78598,[\"8726\",\"static/chunks/8726-fd60949e252ac8d1.js\",\"3185\",\"static/chunks/app/layout-e2ef1005801dc1ed.js\"],\"default\"]\n17:I[56192,[\"8726\",\"static/chunks/8726-fd60949e252ac8d1.js\",\"3185\",\"static/chunks/app/layout-e2ef1005801dc1ed.js\"],\"default\"]\n19:I[76130,[],\"\"]\nd:[\"lang\",\"en\",\"d\"]\ne:[\"subject\",\"selenium-python\",\"d\"]\nf:[\"part\",\"part-3\",\"d\"]\n10:[\"pattern\",\"selenium-python-headless-browser-execution\",\"d\"]\n11:[\"mode\",\"challenge\",\"oc\"]\n1a:[]\n"])</script><script>self.__next_f.push([1,"0:[[[\"$\",\"link\",\"0\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/css/d071dca61fbb01bf.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\"}],[\"$\",\"link\",\"1\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/css/907864b6faf28c32.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\"}]],[\"$\",\"$L9\",null,{\"buildId\":\"leyaa-prod-build-id\",\"assetPrefix\":\"\",\"initialCanonicalUrl\":\"/en/codefly/learn/selenium-python/part-3/selenium-python-headless-browser-execution/challenge\",\"initialTree\":[\"\",{\"children\":[[\"lang\",\"en\",\"d\"],{\"children\":[\"codefly\",{\"children\":[\"learn\",{\"children\":[[\"subject\",\"selenium-python\",\"d\"],{\"children\":[[\"part\",\"part-3\",\"d\"],{\"children\":[[\"pattern\",\"selenium-python-headless-browser-execution\",\"d\"],{\"children\":[[\"mode\",\"challenge\",\"oc\"],{\"children\":[\"__PAGE__\",{}]}]}]}]}]}]}]}]},\"$undefined\",\"$undefined\",true],\"initialSeedData\":[\"\",{\"children\":[[\"lang\",\"en\",\"d\"],{\"children\":[\"codefly\",{\"children\":[\"learn\",{\"children\":[[\"subject\",\"selenium-python\",\"d\"],{\"children\":[[\"part\",\"part-3\",\"d\"],{\"children\":[[\"pattern\",\"selenium-python-headless-browser-execution\",\"d\"],{\"children\":[[\"mode\",\"challenge\",\"oc\"],{\"children\":[\"__PAGE__\",{},[[\"$La\",\"$Lb\"],null],null]},[\"$\",\"$Lc\",null,{\"parallelRouterKey\":\"children\",\"segmentPath\":[\"children\",\"$d\",\"children\",\"codefly\",\"children\",\"learn\",\"children\",\"$e\",\"children\",\"$f\",\"children\",\"$10\",\"children\",\"$11\",\"children\"],\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L12\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"notFoundStyles\":\"$undefined\",\"styles\":[[\"$\",\"link\",\"0\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/css/ada9a246b4e9c7f9.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\"}],[\"$\",\"link\",\"1\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/css/725c7861d1898ba8.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\"}],[\"$\",\"link\",\"2\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/css/a97525600f39e233.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\"}],[\"$\",\"link\",\"3\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/css/989afc350a4b3a28.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\"}],[\"$\",\"link\",\"4\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/css/ccfdf35169bd162c.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\"}],[\"$\",\"link\",\"5\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/css/417e7aee3e688b57.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\"}]]}],null]},[\"$\",\"$Lc\",null,{\"parallelRouterKey\":\"children\",\"segmentPath\":[\"children\",\"$d\",\"children\",\"codefly\",\"children\",\"learn\",\"children\",\"$e\",\"children\",\"$f\",\"children\",\"$10\",\"children\"],\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L12\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"notFoundStyles\":\"$undefined\",\"styles\":null}],null]},[\"$\",\"$Lc\",null,{\"parallelRouterKey\":\"children\",\"segmentPath\":[\"children\",\"$d\",\"children\",\"codefly\",\"children\",\"learn\",\"children\",\"$e\",\"children\",\"$f\",\"children\"],\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L12\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"notFoundStyles\":\"$undefined\",\"styles\":null}],null]},[\"$\",\"$Lc\",null,{\"parallelRouterKey\":\"children\",\"segmentPath\":[\"children\",\"$d\",\"children\",\"codefly\",\"children\",\"learn\",\"children\",\"$e\",\"children\"],\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L12\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"notFoundStyles\":\"$undefined\",\"styles\":null}],null]},[\"$\",\"$Lc\",null,{\"parallelRouterKey\":\"children\",\"segmentPath\":[\"children\",\"$d\",\"children\",\"codefly\",\"children\",\"learn\",\"children\"],\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L12\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"notFoundStyles\":\"$undefined\",\"styles\":null}],null]},[\"$\",\"$Lc\",null,{\"parallelRouterKey\":\"children\",\"segmentPath\":[\"children\",\"$d\",\"children\",\"codefly\",\"children\"],\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L12\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"notFoundStyles\":\"$undefined\",\"styles\":null}],null]},[\"$\",\"$Lc\",null,{\"parallelRouterKey\":\"children\",\"segmentPath\":[\"children\",\"$d\",\"children\"],\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L12\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"notFoundStyles\":\"$undefined\",\"styles\":null}],null]},[[\"$\",\"html\",null,{\"lang\":\"en\",\"children\":[[\"$\",\"head\",null,{\"children\":[[\"$\",\"meta\",null,{\"name\":\"theme-color\",\"content\":\"#5f56fe\"}],[\"$\",\"meta\",null,{\"name\":\"msapplication-TileColor\",\"content\":\"#5f56fe\"}],[\"$\",\"$L13\",null,{\"src\":\"https://www.googletagmanager.com/gtag/js?id=G-N2NY2DMMDW\",\"strategy\":\"afterInteractive\"}],[\"$\",\"$L13\",null,{\"id\":\"google-analytics\",\"strategy\":\"afterInteractive\",\"children\":\"\\n window.dataLayer = window.dataLayer || [];\\n function gtag(){dataLayer.push(arguments);}\\n gtag('js', new Date());\\n gtag('config', 'G-N2NY2DMMDW', {\\n page_path: window.location.pathname,\\n });\\n \"}],[\"$\",\"script\",null,{\"async\":true,\"src\":\"https://www.googletagmanager.com/gtag/js?id=AW-18214378714\"}],[\"$\",\"$L13\",null,{\"children\":\"\\n window.dataLayer = window.dataLayer || [];\\n function gtag() {\\n dataLayer.push(arguments);\\n }\\n gtag('js', new Date());\\n gtag('config', 'AW-18214378714');\\n \"}],[\"$\",\"script\",null,{\"data-grow-initializer\":\"\",\"suppressHydrationWarning\":true,\"dangerouslySetInnerHTML\":{\"__html\":\"!(function(){window.growMe||((window.growMe=function(e){window.growMe._.push(e);}),(window.growMe._=[]));var e=document.createElement(\\\"script\\\");(e.type=\\\"text/javascript\\\"),(e.src=\\\"https://faves.grow.me/main.js\\\"),(e.defer=!0),e.setAttribute(\\\"data-grow-faves-site-id\\\",\\\"U2l0ZTo0MGIxZDBlZC0wNzdlLTQ0NjgtOThmOC1kNDYyZGMwM2IwMWY=\\\");var t=document.getElementsByTagName(\\\"script\\\")[0];t.parentNode.insertBefore(e,t);})();\"}}],[\"$\",\"$L13\",null,{\"src\":\"//scripts.scriptwrapper.com/tags/40b1d0ed-077e-4468-98f8-d462dc03b01f.js\",\"strategy\":\"afterInteractive\",\"data-noptimize\":\"1\",\"data-cfasync\":\"false\"}],[\"$\",\"script\",null,{\"type\":\"application/ld+json\",\"suppressHydrationWarning\":true,\"dangerouslySetInnerHTML\":{\"__html\":\"{\\\"@context\\\":\\\"https://schema.org\\\",\\\"@type\\\":\\\"WebApplication\\\",\\\"name\\\":\\\"Leyaa.ai\\\",\\\"description\\\":\\\"Leyaa.ai builds learning intelligence that understands how you learn - guiding what to study, how to practice, and when to move forward.\\\",\\\"url\\\":\\\"https://leyaa.ai\\\",\\\"applicationCategory\\\":\\\"EducationalApplication\\\",\\\"operatingSystem\\\":\\\"Web\\\",\\\"offers\\\":{\\\"@type\\\":\\\"Offer\\\",\\\"price\\\":\\\"0\\\",\\\"priceCurrency\\\":\\\"USD\\\"},\\\"creator\\\":{\\\"@type\\\":\\\"Organization\\\",\\\"name\\\":\\\"Leyaa.ai\\\"}}\"}}],[\"$\",\"$L13\",null,{\"id\":\"clarity-script\",\"strategy\":\"afterInteractive\",\"dangerouslySetInnerHTML\":{\"__html\":\"\\n (function(c,l,a,r,i,t,y){\\n c[a]=c[a]||function(){(c[a].q=c[a].q||[]).push(arguments)};\\n t=l.createElement(r);t.async=1;t.src=\\\"https://www.clarity.ms/tag/\\\"+i;\\n y=l.getElementsByTagName(r)[0];y.parentNode.insertBefore(t,y);\\n })(window, document, \\\"clarity\\\", \\\"script\\\", \\\"w4gxh6rdmh\\\");\\n \"}}]]}],[\"$\",\"body\",null,{\"children\":[[\"$\",\"$L14\",null,{\"containerStyle\":{\"top\":70}}],[\"$\",\"$Lc\",null,{\"parallelRouterKey\":\"children\",\"segmentPath\":[\"children\"],\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L12\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":[\"$\",\"$L15\",null,{}],\"notFoundStyles\":[[\"$\",\"link\",\"0\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/css/a97525600f39e233.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\"}]],\"styles\":null}],[\"$\",\"$L16\",null,{}],\" \",[\"$\",\"$L17\",null,{}]]}]]}],null],null],\"couldBeIntercepted\":false,\"initialHead\":[false,\"$L18\"],\"globalErrorComponent\":\"$19\",\"missingSlots\":\"$W1a\"}]]\n"])</script><script>self.__next_f.push([1,"1c:I[43489,[\"8422\",\"static/chunks/66ec4792-3d3220126f3e74ee.js\",\"6950\",\"static/chunks/f8025e75-5dd99dd1a689ea97.js\",\"6051\",\"static/chunks/795d4814-8b40e2eae05948ca.js\",\"5706\",\"static/chunks/9c4e2130-0ef90d15550fcb15.js\",\"522\",\"static/chunks/94730671-fd9628eddbd5107b.js\",\"7699\",\"static/chunks/8e1d74a4-d3c1e3cfb4eeea98.js\",\"7240\",\"static/chunks/53c13509-a3e4ac0640ae03f2.js\",\"9956\",\"static/chunks/ee560e2c-27ba7a66c659fa82.js\",\"2516\",\"static/chunks/f7333993-31ab72eb9b202e3d.js\",\"1779\",\"static/chunks/0e762574-cee3ec2351d97ca0.js\",\"6795\",\"static/chunks/6795-1b544390b9b7cb09.js\",\"5214\",\"static/chunks/5214-cc3a3a8017cc6e4d.js\",\"7078\",\"static/chunks/7078-09556dce22020d83.js\",\"4889\",\"static/chunks/4889-de8d1c4f2ff2f134.js\",\"8726\",\"static/chunks/8726-fd60949e252ac8d1.js\",\"7534\",\"static/chunks/7534-02c906a11e681445.js\",\"4220\",\"static/chunks/4220-e3c1264f6e3453a7.js\",\"7562\",\"static/chunks/7562-b71a43604fd32292.js\",\"4481\",\"static/chunks/4481-14671e1e3d1ffff7.js\",\"6857\",\"static/chunks/6857-f9121be732678b30.js\",\"2202\",\"static/chunks/2202-dad5d33fadc7ea73.js\",\"1786\",\"static/chunks/1786-7253d5c3df8362c5.js\",\"7029\",\"static/chunks/app/%5Blang%5D/codefly/learn/%5Bsubject%5D/%5Bpart%5D/%5Bpattern%5D/%5B%5B...mode%5D%5D/page-b11550cd55444a64.js\"],\"default\"]\n1b:T524,{\"@context\":\"https://schema.org\",\"@type\":\"LearningResource\",\"name\":\"Headless browser execution in Selenium Python - Practice Problems \u0026 Coding Challenges\",\"description\":\"Solve Headless browser execution in Selenium Python coding challenges from easy to hard. Practice problems with hints, solutions, and step-by-step explanations. Free practice.\",\"url\":\"https://leyaa.ai/codefly/learn/selenium-python/part-3/selenium-python-headless-browser-execution/challenge\",\"learningResourceType\":\"Quiz\",\"programmingLanguage\":\"Selenium Python\",\"inLanguage\":\"en\",\"isAccessibleForFree\":true,\"teaches\":\"Headless browser execution in Selenium Python - Practice Problems \u0026 Coding Challenges\",\"provider\":{\"@type\":\"Organization\",\"url\":\"https://leyaa.ai\"},\"educationalLevel\":\"Beginner to Advanced\",\"breadc"])</script><script>self.__next_f.push([1,"rumb\":{\"@type\":\"BreadcrumbList\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https://leyaa.ai\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Headless browser execution in Selenium Python - Practice Problems \u0026 Coding Challenges\",\"item\":\"https://leyaa.ai/codefly/learn/selenium-python/part-3/selenium-python-headless-browser-execution\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Challenge\",\"item\":\"https://leyaa.ai/codefly/learn/selenium-python/part-3/selenium-python-headless-browser-execution/challenge\"}]}}1d:T4b3,\u003cdiv class='solution-box'\u003e\u003cspan class='solution-label'\u003e\u003cstrong\u003eSolution:\u003c/strong\u003e\u003c/span\u003e\u003col\u003e\u003cli\u003e\u003ch4\u003eStep 1: Understand Linux server constraints\u003c/h4\u003eLinux servers often lack GUI and have limited shared memory, so Chrome needs extra flags to run headless smoothly.\u003c/li\u003e\u003cli\u003e\u003ch4\u003eStep 2: Identify required ChromeOptions\u003c/h4\u003eAdding '--no-sandbox' and '--disable-dev-shm-usage' helps avoid permission and memory issues on Linux servers.\u003c/li\u003e\u003cli\u003e\u003ch4\u003eStep 3: Evaluate options\u003c/h4\u003eUse ChromeOptions with '--headless' argument and set '--no-sandbox' and '--disable-dev-shm-usage' arguments correctly includes these flags with '--headless'. Use FirefoxOptions with '--headless' and run tests without any additional arguments misses Linux-specific flags. Run Chrome without headless mode but use Xvfb to simulate display uses Xvfb but not headless mode. Use ChromeOptions with '--headless' only; no other arguments needed misses important flags.\u003c/li\u003e\u003cli\u003e\u003ch4\u003eFinal Answer:\u003c/h4\u003e\u003cstrong\u003eUse ChromeOptions with '--headless' argument and set '--no-sandbox' and '--disable-dev-shm-usage' arguments\u003c/strong\u003e -\u003e Option A\u003c/li\u003e\u003cli\u003e\u003ch4\u003eQuick Check:\u003c/h4\u003eLinux headless Chrome needs extra flags for stability [OK]\u003c/li\u003e\u003c/ol\u003e\u003c/div\u003e"])</script><script>self.__next_f.push([1,"b:[[[\"$\",\"script\",\"0\",{\"type\":\"application/ld+json\",\"dangerouslySetInnerHTML\":{\"__html\":\"$1b\"}}]],[\"$\",\"$L1c\",null,{\"subject\":\"selenium-python\",\"dbSubject\":\"selenium_python\",\"part\":\"part-3\",\"pattern\":\"selenium_python_headless_browser_execution\",\"modeSlug\":\"challenge\",\"lang\":\"en\",\"internalLinks\":[{\"code\":\"LMC\",\"slug\":\"\",\"label\":\"📖 Learn\",\"href\":\"/codefly/learn/selenium-python/part-3/selenium-python-headless-browser-execution\",\"active\":false},{\"code\":\"LMCWHY\",\"slug\":\"why\",\"label\":\"💡 Why Learn This\",\"href\":\"/codefly/learn/selenium-python/part-3/selenium-python-headless-browser-execution/why\",\"active\":false},{\"code\":\"DLM\",\"slug\":\"deep\",\"label\":\"💡 Deep Learn Mode\",\"href\":\"/codefly/learn/selenium-python/part-3/selenium-python-headless-browser-execution/deep\",\"active\":false},{\"code\":\"TMC\",\"slug\":\"try\",\"label\":\"✏️ Try It\",\"href\":\"/codefly/learn/selenium-python/part-3/selenium-python-headless-browser-execution/try\",\"active\":false},{\"code\":\"VMC\",\"slug\":\"visualize\",\"label\":\"👁 Visualize\",\"href\":\"/codefly/learn/selenium-python/part-3/selenium-python-headless-browser-execution/visualize\",\"active\":false},{\"code\":\"TCM\",\"slug\":\"complexity\",\"label\":\"⏱ Complexity\",\"href\":\"/codefly/learn/selenium-python/part-3/selenium-python-headless-browser-execution/complexity\",\"active\":false},{\"code\":\"CMC\",\"slug\":\"challenge\",\"label\":\"🏆 Challenge\",\"href\":\"/codefly/learn/selenium-python/part-3/selenium-python-headless-browser-execution/challenge\",\"active\":true},{\"code\":\"PMC\",\"slug\":\"project\",\"label\":\"📁 Project\",\"href\":\"/codefly/learn/selenium-python/part-3/selenium-python-headless-browser-execution/project\",\"active\":false},{\"code\":\"RMC\",\"slug\":\"review\",\"label\":\"🧠 Quick Review\",\"href\":\"/codefly/learn/selenium-python/part-3/selenium-python-headless-browser-execution/review\",\"active\":false}],\"isLoggedIn\":false,\"seoH1\":\"Headless browser execution in Selenium Python - Practice Problems \u0026 Coding Challenges\",\"contentData\":{\"pattern_id\":\"selenium_python_headless_browser_execution\",\"metadata\":{\"slot_map\":{\"LMCWHY\":\"LMCWHY\",\"LMC\":\"LMC\",\"TMC\":\"TMC\",\"CMC\":\"CMC\",\"RMC\":\"RMC\",\"VMC\":\"EXC\",\"TCM\":\"TFW\",\"PMC\":\"AUT\",\"DLM\":\"DLM\"}},\"modes\":{\"CMC\":{\"topic\":\"Headless browser execution\",\"mode\":\"CMC_v4.2\",\"language\":\"selenium_python\",\"content_type\":\"Software Testing \u0026 QA\",\"challenges\":[{\"id\":\"c1\",\"type\":\"code_output\",\"difficulty\":\"intermediate\",\"title\":\"What is the output of this Selenium headless browser code?\",\"prompt\":\"Consider the following Python Selenium code snippet that runs a headless Chrome browser and fetches the page title. What will be printed?\",\"code\":\"from selenium import webdriver\\nfrom selenium.webdriver.chrome.options import Options\\n\\noptions = Options()\\noptions.add_argument('--headless')\\ndriver = webdriver.Chrome(options=options)\\ndriver.get('https://example.com')\\nprint(driver.title)\\ndriver.quit()\",\"ordering_targets\":[],\"options\":{\"A\":\"Example Domain\",\"B\":\"https://example.com\",\"C\":\"selenium.common.exceptions.WebDriverException\",\"D\":\"'' (empty string)\"},\"correct_answer\":[\"A\"],\"time_limit_seconds\":120,\"attempts_allowed\":2,\"hint\":\"The page title is the text inside the \u003ctitle\u003e tag of the loaded page.\",\"explanation\":\"The code opens https://example.com in a headless Chrome browser and prints the page title, which is 'Example Domain'.\",\"solution\":\"The output is 'Example Domain' because that is the title of the page at https://example.com.\",\"tags\":[\"selenium\",\"headless\",\"python\",\"webdriver\"]},{\"id\":\"c2\",\"type\":\"assertion\",\"difficulty\":\"intermediate\",\"title\":\"Which assertion correctly verifies the page title in headless mode?\",\"prompt\":\"You want to assert that the page title is exactly 'Welcome Page' after loading a page in headless mode. Which assertion is correct?\",\"code\":\"from selenium import webdriver\\nfrom selenium.webdriver.chrome.options import Options\\n\\noptions = Options()\\noptions.add_argument('--headless')\\ndriver = webdriver.Chrome(options=options)\\ndriver.get('https://example.com/welcome')\\n\\n# Which assertion below is correct?\\n\",\"ordering_targets\":[],\"options\":{\"A\":\"assert 'Welcome Page' in driver.title()\",\"B\":\"assert driver.title.contains('Welcome Page')\",\"C\":\"assert driver.title == 'Welcome Page'\",\"D\":\"assert driver.title.equals('Welcome Page')\"},\"correct_answer\":[\"C\"],\"time_limit_seconds\":120,\"attempts_allowed\":2,\"hint\":\"Check the correct Python syntax for string equality and attribute access.\",\"explanation\":\"The page title is accessed as a string attribute driver.title. The correct way to assert equality is 'assert driver.title == \\\"Welcome Page\\\"'.\",\"solution\":\"Use 'assert driver.title == \\\"Welcome Page\\\"' to verify the exact page title.\",\"tags\":[\"selenium\",\"headless\",\"assertion\",\"python\"]},{\"id\":\"c3\",\"type\":\"debug\",\"difficulty\":\"advanced\",\"title\":\"Why does this headless browser test fail to find the element?\",\"prompt\":\"This Selenium test runs in headless mode but fails to find the element with id 'submit-btn'. What is the likely cause?\",\"code\":\"from selenium import webdriver\\nfrom selenium.webdriver.chrome.options import Options\\nfrom selenium.webdriver.common.by import By\\n\\noptions = Options()\\noptions.add_argument('--headless')\\ndriver = webdriver.Chrome(options=options)\\ndriver.get('https://example.com/form')\\nsubmit_button = driver.find_element(By.ID, 'submit-btn')\\nsubmit_button.click()\\ndriver.quit()\",\"ordering_targets\":[],\"options\":{\"A\":\"Headless mode disables JavaScript, so the element is not rendered.\",\"B\":\"The element is inside an iframe and needs switching to the iframe first.\",\"C\":\"The element ID is misspelled in the locator.\",\"D\":\"The page URL is incorrect and returns 404.\"},\"correct_answer\":[\"B\"],\"time_limit_seconds\":150,\"attempts_allowed\":2,\"hint\":\"Check if the element is inside a frame or iframe that requires switching context.\",\"explanation\":\"In headless mode, the page renders normally including iframes. If the element is inside an iframe, Selenium must switch to that iframe before locating the element.\",\"solution\":\"Switch to the iframe using driver.switch_to.frame() before finding the element.\",\"tags\":[\"selenium\",\"headless\",\"debugging\",\"iframe\"]},{\"id\":\"c4\",\"type\":\"framework\",\"difficulty\":\"advanced\",\"title\":\"Which setup correctly initializes a headless Firefox browser in pytest fixture?\",\"prompt\":\"You want to create a pytest fixture that provides a headless Firefox WebDriver instance. Which code snippet is correct?\",\"code\":\"\",\"ordering_targets\":[],\"options\":{\"A\":\"import pytest\\nfrom selenium import webdriver\\nfrom selenium.webdriver.firefox.options import Options\\n\\n@pytest.fixture\\ndef driver():\\n options = Options()\\n driver = webdriver.Firefox()\\n yield driver\\n driver.quit()\",\"B\":\"import pytest\\nfrom selenium import webdriver\\nfrom selenium.webdriver.firefox.options import Options\\n\\n@pytest.fixture\\ndef driver():\\n options = Options()\\n options.add_argument('--headless')\\n driver = webdriver.Firefox(options=options)\\n yield driver\\n driver.close()\",\"C\":\"import pytest\\nfrom selenium import webdriver\\nfrom selenium.webdriver.firefox.options import Options\\n\\n@pytest.fixture\\ndef driver():\\n options = Options()\\n options.headless = False\\n driver = webdriver.Firefox(options=options)\\n yield driver\\n driver.quit()\",\"D\":\"import pytest\\nfrom selenium import webdriver\\nfrom selenium.webdriver.firefox.options import Options\\n\\n@pytest.fixture\\ndef driver():\\n options = Options()\\n options.headless = True\\n driver = webdriver.Firefox(options=options)\\n yield driver\\n driver.quit()\"},\"correct_answer\":[\"D\"],\"time_limit_seconds\":150,\"attempts_allowed\":2,\"hint\":\"Check how to set headless mode for Firefox using the Options class.\",\"explanation\":\"For Firefox, setting options.headless = True enables headless mode. Using options.add_argument('--headless') is not correct for Firefox. driver.quit() properly closes the browser.\",\"solution\":\"Use options.headless = True and driver.quit() in the fixture to correctly setup headless Firefox.\",\"tags\":[\"selenium\",\"headless\",\"pytest\",\"firefox\"]},{\"id\":\"c5\",\"type\":\"conceptual\",\"difficulty\":\"expert\",\"title\":\"What is a key limitation of headless browser testing compared to headed mode?\",\"prompt\":\"Which of the following is a common limitation when running tests in headless browser mode compared to headed (normal) mode?\",\"code\":\"\",\"ordering_targets\":[],\"options\":{\"A\":\"Some visual rendering issues or animations may not behave exactly the same, causing false negatives.\",\"B\":\"Headless mode always runs slower than headed mode due to lack of GPU acceleration.\",\"C\":\"Headless browsers cannot execute JavaScript, so dynamic pages fail to load.\",\"D\":\"Headless mode disables network requests, so pages do not load any resources.\"},\"correct_answer\":[\"A\"],\"time_limit_seconds\":180,\"attempts_allowed\":2,\"hint\":\"Think about differences in rendering and user interface behavior between headless and headed browsers.\",\"explanation\":\"Headless browsers may render pages slightly differently, especially with animations or complex CSS, which can cause tests to fail even if the headed browser works fine.\",\"solution\":\"Be aware that headless mode can cause visual differences leading to false negatives in UI tests.\",\"tags\":[\"selenium\",\"headless\",\"limitations\",\"concepts\"]}],\"achievement_badge\":{\"name\":\"Headless Browser Mastery\",\"condition\":\"complete_all_5\"},\"metadata\":{\"version\":\"4.2\",\"content_type\":\"testing\",\"total_challenges\":5,\"estimated_time_minutes\":20}}},\"subject\":\"selenium_python\",\"title\":\"Headless browser execution\",\"puzzleDetails\":[{\"_id\":\"69b1786a45baa2b58548a2f3\",\"question_number\":1,\"question\":\"What is the main advantage of running Selenium tests in headless mode?\",\"options\":{\"A\":\"It requires more system resources than normal mode\",\"B\":\"It allows manual interaction with the browser during tests\",\"C\":\"Tests run faster without opening a visible browser window\",\"D\":\"It disables all JavaScript on the web page\"},\"correct_answer\":[\"C\"],\"solution_explanation\":\"\u003cdiv class='solution-box'\u003e\u003cspan class='solution-label'\u003e\u003cstrong\u003eSolution:\u003c/strong\u003e\u003c/span\u003e\u003col\u003e\u003cli\u003e\u003ch4\u003eStep 1: Understand headless mode purpose\u003c/h4\u003eHeadless mode runs browser tests without showing the browser window, saving time and resources.\u003c/li\u003e\u003cli\u003e\u003ch4\u003eStep 2: Compare options\u003c/h4\u003eOnly Tests run faster without opening a visible browser window correctly states that tests run faster without opening a visible window. Other options are incorrect or unrelated.\u003c/li\u003e\u003cli\u003e\u003ch4\u003eFinal Answer:\u003c/h4\u003e\u003cstrong\u003eTests run faster without opening a visible browser window\u003c/strong\u003e -\u003e Option C\u003c/li\u003e\u003cli\u003e\u003ch4\u003eQuick Check:\u003c/h4\u003eHeadless mode = faster tests without UI [OK]\u003c/li\u003e\u003c/ol\u003e\u003c/div\u003e\",\"quick_trick\":\"Headless means no browser window visible during tests [OK]\",\"common_mistakes\":[\"Thinking headless disables JavaScript\",\"Assuming headless mode allows manual browser control\",\"Believing headless uses more resources\"],\"subject\":\"selenium_python\",\"pattern\":\"Headless browser execution\",\"category\":\"Software Testing \u0026 QA\",\"question_format\":\"MCQ\",\"question_mode\":\"conceptual\",\"difficulty\":\"easy\",\"topic\":\"Cross-Browser Testing\",\"type\":\"Software Testing \u0026 QA\",\"question_type\":\"conceptual\",\"level\":\"easy\",\"test_type\":\"puzzle\",\"pattern_id\":\"selenium_python_headless_browser_execution\",\"subjectTitle\":\"Selenium Python\",\"part\":\"part-3\",\"set_no\":1,\"usage_count\":0,\"topic_id\":\"selenium_python_p3_t3\"},{\"_id\":\"69b1786a45baa2b58548a2f4\",\"question_number\":2,\"question\":\"Which of the following is the correct way to enable headless mode in Selenium with Python using Chrome?\",\"options\":{\"A\":\"options = webdriver.ChromeOptions()\\noptions.add_argument('--headless')\\ndriver = webdriver.Chrome(options=options)\",\"B\":\"driver = webdriver.Chrome(headless=True)\",\"C\":\"options = webdriver.ChromeOptions()\\noptions.headless = True\\ndriver = webdriver.Chrome(options=options)\",\"D\":\"driver = webdriver.Chrome()\\ndriver.set_headless(True)\"},\"correct_answer\":[\"A\"],\"solution_explanation\":\"\u003cdiv class='solution-box'\u003e\u003cspan class='solution-label'\u003e\u003cstrong\u003eSolution:\u003c/strong\u003e\u003c/span\u003e\u003col\u003e\u003cli\u003e\u003ch4\u003eStep 1: Review Selenium headless syntax\u003c/h4\u003eTo enable headless mode, you add the '--headless' argument to ChromeOptions and pass it to the driver.\u003c/li\u003e\u003cli\u003e\u003ch4\u003eStep 2: Analyze options\u003c/h4\u003eoptions = webdriver.ChromeOptions()\\noptions.add_argument('--headless')\\ndriver = webdriver.Chrome(options=options) correctly uses options.add_argument('--headless') and passes options to Chrome. options = webdriver.ChromeOptions()\\noptions.headless = True\\ndriver = webdriver.Chrome(options=options) incorrectly sets options.headless (not standard). Options B and D use invalid syntax.\u003c/li\u003e\u003cli\u003e\u003ch4\u003eFinal Answer:\u003c/h4\u003e\u003cstrong\u003eoptions = webdriver.ChromeOptions()\\noptions.add_argument('--headless')\\ndriver = webdriver.Chrome(options=options)\u003c/strong\u003e -\u003e Option A\u003c/li\u003e\u003cli\u003e\u003ch4\u003eQuick Check:\u003c/h4\u003eUse add_argument('--headless') to enable headless [OK]\u003c/li\u003e\u003c/ol\u003e\u003c/div\u003e\",\"quick_trick\":\"Use add_argument('--headless') on ChromeOptions [OK]\",\"common_mistakes\":[\"Setting options.headless = True (not standard)\",\"Passing headless=True directly to webdriver.Chrome()\",\"Calling non-existent set_headless method\"],\"subject\":\"selenium_python\",\"pattern\":\"Headless browser execution\",\"category\":\"Software Testing \u0026 QA\",\"question_format\":\"MCQ\",\"question_mode\":\"syntax\",\"difficulty\":\"easy\",\"topic\":\"Cross-Browser Testing\",\"type\":\"Software Testing \u0026 QA\",\"question_type\":\"syntax\",\"level\":\"easy\",\"test_type\":\"puzzle\",\"pattern_id\":\"selenium_python_headless_browser_execution\",\"subjectTitle\":\"Selenium Python\",\"part\":\"part-3\",\"set_no\":1,\"usage_count\":0,\"topic_id\":\"selenium_python_p3_t3\"},{\"_id\":\"69b1786a45baa2b58548a2f5\",\"question_number\":3,\"question\":\"What will be the output of the following code snippet?\\n\u003cpre\u003efrom selenium import webdriver\\noptions = webdriver.ChromeOptions()\\noptions.add_argument('--headless')\\ndriver = webdriver.Chrome(options=options)\\ndriver.get('https://example.com')\\nprint(driver.title)\\ndriver.quit()\u003c/pre\u003e\",\"options\":{\"A\":\"Opens a visible browser window and prints the title\",\"B\":\"Raises an error because headless mode cannot get page title\",\"C\":\"Prints an empty string because page is not loaded in headless mode\",\"D\":\"Prints the title of the page 'Example Domain' without opening a browser window\"},\"correct_answer\":[\"D\"],\"solution_explanation\":\"\u003cdiv class='solution-box'\u003e\u003cspan class='solution-label'\u003e\u003cstrong\u003eSolution:\u003c/strong\u003e\u003c/span\u003e\u003col\u003e\u003cli\u003e\u003ch4\u003eStep 1: Understand headless execution effect\u003c/h4\u003eHeadless mode runs browser without UI but fully loads pages and executes scripts.\u003c/li\u003e\u003cli\u003e\u003ch4\u003eStep 2: Analyze code behavior\u003c/h4\u003eThe code loads 'https://example.com' and prints the page title. Headless mode does not prevent getting the title, so it prints 'Example Domain'.\u003c/li\u003e\u003cli\u003e\u003ch4\u003eFinal Answer:\u003c/h4\u003e\u003cstrong\u003ePrints the title of the page 'Example Domain' without opening a browser window\u003c/strong\u003e -\u003e Option D\u003c/li\u003e\u003cli\u003e\u003ch4\u003eQuick Check:\u003c/h4\u003eHeadless loads page and gets title correctly [OK]\u003c/li\u003e\u003c/ol\u003e\u003c/div\u003e\",\"quick_trick\":\"Headless runs full browser without UI, so title is accessible [OK]\",\"common_mistakes\":[\"Assuming headless mode blocks page loading\",\"Expecting errors when accessing page title in headless\",\"Thinking headless opens visible browser window\"],\"subject\":\"selenium_python\",\"pattern\":\"Headless browser execution\",\"category\":\"Software Testing \u0026 QA\",\"question_format\":\"MCQ\",\"question_mode\":\"code_output\",\"difficulty\":\"medium\",\"topic\":\"Cross-Browser Testing\",\"type\":\"Software Testing \u0026 QA\",\"question_type\":\"code_output\",\"level\":\"medium\",\"test_type\":\"puzzle\",\"pattern_id\":\"selenium_python_headless_browser_execution\",\"subjectTitle\":\"Selenium Python\",\"part\":\"part-3\",\"set_no\":1,\"usage_count\":0,\"topic_id\":\"selenium_python_p3_t3\"},{\"_id\":\"69b1786a45baa2b58548a2f6\",\"question_number\":4,\"question\":\"You wrote this code to run Chrome in headless mode but the browser window still appears. What is the likely mistake?\\n\u003cpre\u003efrom selenium import webdriver\\noptions = webdriver.ChromeOptions()\\ndriver = webdriver.Chrome(options=options)\\noptions.add_argument('--headless')\\ndriver.get('https://example.com')\u003c/pre\u003e\",\"options\":{\"A\":\"Headless mode is not supported on Chrome\",\"B\":\"The headless argument was added after creating the driver, so it was ignored\",\"C\":\"You must call driver.set_headless(True) after creating the driver\",\"D\":\"You forgot to call driver.quit() to close the window\"},\"correct_answer\":[\"B\"],\"solution_explanation\":\"\u003cdiv class='solution-box'\u003e\u003cspan class='solution-label'\u003e\u003cstrong\u003eSolution:\u003c/strong\u003e\u003c/span\u003e\u003col\u003e\u003cli\u003e\u003ch4\u003eStep 1: Check order of setting options\u003c/h4\u003eThe headless argument must be added to options before creating the driver instance.\u003c/li\u003e\u003cli\u003e\u003ch4\u003eStep 2: Identify mistake in code\u003c/h4\u003eHere, options.add_argument('--headless') is called after driver creation, so the driver does not run headless.\u003c/li\u003e\u003cli\u003e\u003ch4\u003eFinal Answer:\u003c/h4\u003e\u003cstrong\u003eThe headless argument was added after creating the driver, so it was ignored\u003c/strong\u003e -\u003e Option B\u003c/li\u003e\u003cli\u003e\u003ch4\u003eQuick Check:\u003c/h4\u003eAdd headless argument before driver creation [OK]\u003c/li\u003e\u003c/ol\u003e\u003c/div\u003e\",\"quick_trick\":\"Add headless option before creating driver instance [OK]\",\"common_mistakes\":[\"Adding headless argument after driver creation\",\"Calling non-existent set_headless method\",\"Assuming headless unsupported on Chrome\"],\"subject\":\"selenium_python\",\"pattern\":\"Headless browser execution\",\"category\":\"Software Testing \u0026 QA\",\"question_format\":\"MCQ\",\"question_mode\":\"debug\",\"difficulty\":\"medium\",\"topic\":\"Cross-Browser Testing\",\"type\":\"Software Testing \u0026 QA\",\"question_type\":\"debug\",\"level\":\"medium\",\"test_type\":\"puzzle\",\"pattern_id\":\"selenium_python_headless_browser_execution\",\"subjectTitle\":\"Selenium Python\",\"part\":\"part-3\",\"set_no\":1,\"usage_count\":0,\"topic_id\":\"selenium_python_p3_t3\"},{\"_id\":\"69b1786a45baa2b58548a2f7\",\"question_number\":5,\"question\":\"You want to run Selenium tests in headless mode on a Linux server without a display. Which combination of steps is correct to ensure tests run smoothly?\",\"options\":{\"A\":\"Use ChromeOptions with '--headless' argument and set '--no-sandbox' and '--disable-dev-shm-usage' arguments\",\"B\":\"Use FirefoxOptions with '--headless' and run tests without any additional arguments\",\"C\":\"Run Chrome without headless mode but use Xvfb to simulate display\",\"D\":\"Use ChromeOptions with '--headless' only; no other arguments needed\"},\"correct_answer\":[\"A\"],\"solution_explanation\":\"$1d\",\"quick_trick\":\"Add '--no-sandbox' and '--disable-dev-shm-usage' on Linux [OK]\",\"common_mistakes\":[\"Using headless without Linux-specific flags\",\"Assuming Firefox needs no extra setup\",\"Relying on Xvfb instead of headless mode\"],\"subject\":\"selenium_python\",\"pattern\":\"Headless browser execution\",\"category\":\"Software Testing \u0026 QA\",\"question_format\":\"MCQ\",\"question_mode\":\"application\",\"difficulty\":\"hard\",\"topic\":\"Cross-Browser Testing\",\"type\":\"Software Testing \u0026 QA\",\"question_type\":\"application\",\"level\":\"hard\",\"test_type\":\"puzzle\",\"pattern_id\":\"selenium_python_headless_browser_execution\",\"subjectTitle\":\"Selenium Python\",\"part\":\"part-3\",\"set_no\":1,\"usage_count\":0,\"topic_id\":\"selenium_python_p3_t3\"}]},\"syllabusData\":{\"part\":\"part-3\",\"subject\":\"selenium_python\",\"difficulty\":\"advanced\",\"metadata\":{\"total_topics\":6,\"total_patterns\":43,\"patterns_with_content\":43,\"created_at\":\"2026-03-03T15:53:25.076354Z\",\"version\":\"4.2\",\"upload_tool\":\"upload_to_mongo.py v2.0\"},\"part_title\":\"Advanced\",\"subjectTitle\":\"Selenium Python\",\"topics\":[{\"topic_id\":\"selenium_python_p3_t1\",\"title\":\"Test Framework Integration (pytest)\",\"order\":1,\"pattern_count\":8,\"patterns\":[{\"pattern_id\":\"selenium_python_why_test_frameworks_structure_execution\",\"title\":\"Why test frameworks structure execution\",\"order\":1,\"has_content\":true},{\"pattern_id\":\"selenium_python_pytest_with_selenium_setup\",\"title\":\"pytest with Selenium setup\",\"order\":2,\"has_content\":true},{\"pattern_id\":\"selenium_python_test_functions_and_classes\",\"title\":\"Test functions and classes\",\"order\":3,\"has_content\":true},{\"pattern_id\":\"selenium_python_fixtures_for_browser_setup_teardown\",\"title\":\"Fixtures for browser setup/teardown\",\"order\":4,\"has_content\":true},{\"pattern_id\":\"selenium_python_parameterized_tests\",\"title\":\"Parameterized tests\",\"order\":5,\"has_content\":true},{\"pattern_id\":\"selenium_python_markers_for_categorization\",\"title\":\"Markers for categorization\",\"order\":6,\"has_content\":true},{\"pattern_id\":\"selenium_python_conftest_for_shared_fixtures\",\"title\":\"Conftest for shared fixtures\",\"order\":7,\"has_content\":true},{\"pattern_id\":\"selenium_python_html_report_generation\",\"title\":\"HTML report generation\",\"order\":8,\"has_content\":true}]},{\"topic_id\":\"selenium_python_p3_t2\",\"title\":\"Data-Driven Testing\",\"order\":2,\"pattern_count\":6,\"patterns\":[{\"pattern_id\":\"selenium_python_why_datadriven_tests_increase_coverage\",\"title\":\"Why data-driven tests increase coverage\",\"order\":1,\"has_content\":true},{\"pattern_id\":\"selenium_python_reading_test_data_from_csv\",\"title\":\"Reading test data from CSV\",\"order\":2,\"has_content\":true},{\"pattern_id\":\"selenium_python_reading_test_data_from_excel\",\"title\":\"Reading test data from Excel\",\"order\":3,\"has_content\":true},{\"pattern_id\":\"selenium_python_reading_test_data_from_json\",\"title\":\"Reading test data from JSON\",\"order\":4,\"has_content\":true},{\"pattern_id\":\"selenium_python_parameterize_with_test_data\",\"title\":\"Parameterize with test data\",\"order\":5,\"has_content\":true},{\"pattern_id\":\"selenium_python_data_providers_pattern\",\"title\":\"Data providers pattern\",\"order\":6,\"has_content\":true}]},{\"topic_id\":\"selenium_python_p3_t3\",\"title\":\"Cross-Browser Testing\",\"order\":3,\"pattern_count\":7,\"patterns\":[{\"pattern_id\":\"selenium_python_why_crossbrowser_ensures_compatibility\",\"title\":\"Why cross-browser ensures compatibility\",\"order\":1,\"has_content\":true},{\"pattern_id\":\"selenium_python_chrome_configuration\",\"title\":\"Chrome configuration\",\"order\":2,\"has_content\":true},{\"pattern_id\":\"selenium_python_firefox_configuration\",\"title\":\"Firefox configuration\",\"order\":3,\"has_content\":true},{\"pattern_id\":\"selenium_python_edge_configuration\",\"title\":\"Edge configuration\",\"order\":4,\"has_content\":true},{\"pattern_id\":\"selenium_python_headless_browser_execution\",\"title\":\"Headless browser execution\",\"order\":5,\"has_content\":true},{\"pattern_id\":\"selenium_python_browser_options_and_capabilities\",\"title\":\"Browser options and capabilities\",\"order\":6,\"has_content\":true},{\"pattern_id\":\"selenium_python_browserspecific_workarounds\",\"title\":\"Browser-specific workarounds\",\"order\":7,\"has_content\":true}]},{\"topic_id\":\"selenium_python_p3_t4\",\"title\":\"Selenium Grid\",\"order\":4,\"pattern_count\":6,\"patterns\":[{\"pattern_id\":\"selenium_python_why_grid_enables_parallel_execution\",\"title\":\"Why Grid enables parallel execution\",\"order\":1,\"has_content\":true},{\"pattern_id\":\"selenium_python_grid_architecture_hub_and_node\",\"title\":\"Grid architecture (hub and node)\",\"order\":2,\"has_content\":true},{\"pattern_id\":\"selenium_python_grid_setup_and_configuration\",\"title\":\"Grid setup and configuration\",\"order\":3,\"has_content\":true},{\"pattern_id\":\"selenium_python_running_tests_on_grid\",\"title\":\"Running tests on Grid\",\"order\":4,\"has_content\":true},{\"pattern_id\":\"selenium_python_dockerbased_grid\",\"title\":\"Docker-based Grid\",\"order\":5,\"has_content\":true},{\"pattern_id\":\"selenium_python_cloud_testing_platforms_browserstack_sauce_labs\",\"title\":\"Cloud testing platforms (BrowserStack, Sauce Labs)\",\"order\":6,\"has_content\":true}]},{\"topic_id\":\"selenium_python_p3_t5\",\"title\":\"Advanced Patterns\",\"order\":5,\"pattern_count\":8,\"patterns\":[{\"pattern_id\":\"selenium_python_why_advanced_patterns_solve_real_challenges\",\"title\":\"Why advanced patterns solve real challenges\",\"order\":1,\"has_content\":true},{\"pattern_id\":\"selenium_python_retry_mechanism_for_flaky_tests\",\"title\":\"Retry mechanism for flaky tests\",\"order\":2,\"has_content\":true},{\"pattern_id\":\"selenium_python_custom_expected_conditions\",\"title\":\"Custom expected conditions\",\"order\":3,\"has_content\":true},{\"pattern_id\":\"selenium_python_file_download_handling\",\"title\":\"File download handling\",\"order\":4,\"has_content\":true},{\"pattern_id\":\"selenium_python_cookie_management\",\"title\":\"Cookie management\",\"order\":5,\"has_content\":true},{\"pattern_id\":\"selenium_python_browser_profile_configuration\",\"title\":\"Browser profile configuration\",\"order\":6,\"has_content\":true},{\"pattern_id\":\"selenium_python_handling_captchas_strategies\",\"title\":\"Handling CAPTCHAs (strategies)\",\"order\":7,\"has_content\":true},{\"pattern_id\":\"selenium_python_performance_metrics_collection\",\"title\":\"Performance metrics collection\",\"order\":8,\"has_content\":true}]},{\"topic_id\":\"selenium_python_p3_t6\",\"title\":\"CI/CD Integration\",\"order\":6,\"pattern_count\":8,\"patterns\":[{\"pattern_id\":\"selenium_python_why_ci_integration_enables_continuous_testing\",\"title\":\"Why CI integration enables continuous testing\",\"order\":1,\"has_content\":true},{\"pattern_id\":\"selenium_python_running_selenium_in_ci_pipeline\",\"title\":\"Running Selenium in CI pipeline\",\"order\":2,\"has_content\":true},{\"pattern_id\":\"selenium_python_jenkins_integration\",\"title\":\"Jenkins integration\",\"order\":3,\"has_content\":true},{\"pattern_id\":\"selenium_python_github_actions_integration\",\"title\":\"GitHub Actions integration\",\"order\":4,\"has_content\":true},{\"pattern_id\":\"selenium_python_docker_containers_for_test_execution\",\"title\":\"Docker containers for test execution\",\"order\":5,\"has_content\":true},{\"pattern_id\":\"selenium_python_test_reporting_in_ci\",\"title\":\"Test reporting in CI\",\"order\":6,\"has_content\":true},{\"pattern_id\":\"selenium_python_parallel_execution_in_ci\",\"title\":\"Parallel execution in CI\",\"order\":7,\"has_content\":true},{\"pattern_id\":\"selenium_python_headless_mode_for_ci\",\"title\":\"Headless mode for CI\",\"order\":8,\"has_content\":true}]}]},\"modeCode\":\"CMC\",\"productId\":\"codefly\"}]]\n"])</script><script>self.__next_f.push([1,"18:[[\"$\",\"meta\",\"0\",{\"name\":\"viewport\",\"content\":\"width=device-width, initial-scale=1\"}],[\"$\",\"meta\",\"1\",{\"charSet\":\"utf-8\"}],[\"$\",\"title\",\"2\",{\"children\":\"Headless browser execution in Selenium Python Practice Problems - Coding Exercises | Leyaa.ai\"}],[\"$\",\"meta\",\"3\",{\"name\":\"description\",\"content\":\"Solve Headless browser execution in Selenium Python coding challenges from easy to hard. Practice problems with hints, solutions, and step-by-step explanations. Free practice.\"}],[\"$\",\"meta\",\"4\",{\"name\":\"author\",\"content\":\"Leyaa.ai\"}],[\"$\",\"link\",\"5\",{\"rel\":\"manifest\",\"href\":\"/manifest.json\",\"crossOrigin\":\"use-credentials\"}],[\"$\",\"meta\",\"6\",{\"name\":\"keywords\",\"content\":\"learning intelligence,AI learning,personalized learning,adaptive learning,study guide,exam preparation,learning platform,education technology,edtech,smart learning\"}],[\"$\",\"meta\",\"7\",{\"name\":\"creator\",\"content\":\"Leyaa.ai\"}],[\"$\",\"meta\",\"8\",{\"name\":\"publisher\",\"content\":\"Leyaa.ai\"}],[\"$\",\"meta\",\"9\",{\"name\":\"robots\",\"content\":\"index, follow\"}],[\"$\",\"meta\",\"10\",{\"name\":\"googlebot\",\"content\":\"index, follow, max-image-preview:large, max-snippet:-1\"}],[\"$\",\"meta\",\"11\",{\"name\":\"mobile-web-app-capable\",\"content\":\"yes\"}],[\"$\",\"meta\",\"12\",{\"name\":\"content-language\",\"content\":\"en\"}],[\"$\",\"link\",\"13\",{\"rel\":\"canonical\",\"href\":\"https://leyaa.ai/codefly/learn/selenium-python/part-3/selenium-python-headless-browser-execution/challenge\"}],[\"$\",\"link\",\"14\",{\"rel\":\"alternate\",\"hrefLang\":\"en\",\"href\":\"https://leyaa.ai/codefly/learn/selenium-python/part-3/selenium-python-headless-browser-execution/challenge\"}],[\"$\",\"link\",\"15\",{\"rel\":\"alternate\",\"hrefLang\":\"x-default\",\"href\":\"https://leyaa.ai/codefly/learn/selenium-python/part-3/selenium-python-headless-browser-execution/challenge\"}],[\"$\",\"meta\",\"16\",{\"name\":\"apple-mobile-web-app-capable\",\"content\":\"yes\"}],[\"$\",\"meta\",\"17\",{\"name\":\"apple-mobile-web-app-title\",\"content\":\"Leyaa\"}],[\"$\",\"meta\",\"18\",{\"name\":\"apple-mobile-web-app-status-bar-style\",\"content\":\"default\"}],[\"$\",\"meta\",\"19\",{\"property\":\"og:title\",\"content\":\"Headless browser execution in Selenium Python Practice Problems - Coding Exercises | Leyaa.ai\"}],[\"$\",\"meta\",\"20\",{\"property\":\"og:description\",\"content\":\"Solve Headless browser execution in Selenium Python coding challenges from easy to hard. Practice problems with hints, solutions, and step-by-step explanations. Free practice.\"}],[\"$\",\"meta\",\"21\",{\"property\":\"og:url\",\"content\":\"https://leyaa.ai/codefly/learn/selenium-python/part-3/selenium-python-headless-browser-execution/challenge\"}],[\"$\",\"meta\",\"22\",{\"property\":\"og:locale\",\"content\":\"en_US\"}],[\"$\",\"meta\",\"23\",{\"property\":\"og:image\",\"content\":\"https://leyaa.ai/Assets/metaImages/leyaa-preview-image.png\"}],[\"$\",\"meta\",\"24\",{\"property\":\"og:image:width\",\"content\":\"1200\"}],[\"$\",\"meta\",\"25\",{\"property\":\"og:image:height\",\"content\":\"630\"}],[\"$\",\"meta\",\"26\",{\"property\":\"og:image:alt\",\"content\":\"Headless browser execution in Selenium Python Practice Problems - Coding Exercises\"}],[\"$\",\"meta\",\"27\",{\"property\":\"og:type\",\"content\":\"article\"}],[\"$\",\"meta\",\"28\",{\"name\":\"twitter:card\",\"content\":\"summary_large_image\"}],[\"$\",\"meta\",\"29\",{\"name\":\"twitter:site\",\"content\":\"@leyaaai\"}],[\"$\",\"meta\",\"30\",{\"name\":\"twitter:creator\",\"content\":\"@leyaaai\"}],[\"$\",\"meta\",\"31\",{\"name\":\"twitter:title\",\"content\":\"Headless browser execution in Selenium Python Practice Problems - Coding Exercises | Leyaa.ai\"}],[\"$\",\"meta\",\"32\",{\"name\":\"twitter:description\",\"content\":\"Solve Headless browser execution in Selenium Python coding challenges from easy to hard. Practice problems with hints, solutions, and step-by-step explanations. Free practice.\"}],[\"$\",\"meta\",\"33\",{\"name\":\"twitter:image\",\"content\":\"https://leyaa.ai/Assets/metaImages/leyaa-preview-image.png\"}],[\"$\",\"link\",\"34\",{\"rel\":\"icon\",\"href\":\"/leyaa-logo.png\"}],[\"$\",\"link\",\"35\",{\"rel\":\"apple-touch-icon\",\"href\":\"https://leyaa.ai/Assets/Favicons/apple-touch-icon.png\"}],[\"$\",\"meta\",\"36\",{\"name\":\"next-size-adjust\"}]]\n"])</script><script>self.__next_f.push([1,"a:null\n"])</script></body></html>