Bird
Raised Fist0
Selenium Pythontesting~20 mins

Page title and URL retrieval in Selenium Python - Practice Problems & Coding Challenges

Choose your learning style10 modes available
Challenge - 5 Problems
🎖️
Page Title & URL Master
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 Python code snippet?
Consider the following Selenium code that opens a webpage and prints the title and current URL. What will be printed?
Selenium Python
from selenium import webdriver
from selenium.webdriver.chrome.service import Service
from selenium.webdriver.common.by import By

service = Service('/path/to/chromedriver')
driver = webdriver.Chrome(service=service)
driver.get('https://example.com')
print(driver.title)
print(driver.current_url)
driver.quit()
A
Example Domain
https://example.com/
B
Example Domain
https://www.example.com/
C
example domain
https://example.com
D
Example Domain
https://example.com
Attempts:
2 left
💡 Hint
Check the exact title text and URL format of https://example.com in a browser.
❓ assertion
intermediate
1:30remaining
Which assertion correctly verifies the page title after navigation?
You want to check that after navigating to 'https://example.com', the page title is exactly 'Example Domain'. Which assertion is correct?
Selenium Python
from selenium import webdriver
from selenium.webdriver.chrome.service import Service

service = Service('/path/to/chromedriver')
driver = webdriver.Chrome(service=service)
driver.get('https://example.com')

# Which assertion below is correct?
Aassert driver.title == 'Example Domain'
Bassert driver.title = 'Example Domain'
Cassert driver.title.contains('Example Domain')
Dassert driver.title != 'Example Domain'
Attempts:
2 left
💡 Hint
Remember the syntax for equality comparison in Python assertions.
❓ locator
advanced
2:00remaining
Which locator strategy is best to retrieve the page title element for testing?
You want to locate the HTML element that contains the page title text on 'https://example.com' for validation. Which locator is best?
Adriver.find_element(By.ID, 'title')
Bdriver.find_element(By.TAG_NAME, 'title')
Cdriver.find_element(By.CLASS_NAME, 'title')
Ddriver.find_element(By.CSS_SELECTOR, 'head > title')
Attempts:
2 left
💡 Hint
The page title is inside the tag in the <head> section.</div></div><div class="feedback-box incorrect d-none"><div class="feedback-title">✗ Incorrect</div><div class="feedback-text">The <title> tag is a unique tag inside <head>. Using By.TAG_NAME with 'title' correctly locates it. The other options look for id or class which do not exist on the <title> tag. CSS selector 'head > title' is valid but Selenium does not support locating <title> reliably with CSS selectors.</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 Selenium code fail to get the current URL?</div><div>This code snippet throws an AttributeError. Identify the 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.service <span class="hl-kw">import</span> Service service = Service(<span class="hl-str">'/path/to/chromedriver'</span>) driver = webdriver.Chrome(service=service) driver.get(<span class="hl-str">'https://example.com'</span>) url = driver.get.current_url <span class="hl-fn">print</span>(url) 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">'driver.get' returns None, so accessing 'current_url' fails</span></div><div class="task-option "><span class="task-option-key">B</span><span class="text-pre-wrap">'current_url' is a method and needs parentheses</span></div><div class="task-option "><span class="task-option-key">C</span><span class="text-pre-wrap">'driver' object has no attribute 'get'</span></div><div class="task-option "><span class="task-option-key">D</span><span class="text-pre-wrap">'get' is a method, not an object; 'current_url' is an attribute of driver, not driver.get</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 difference between methods and attributes on the driver object.</div></div><div class="feedback-box incorrect d-none"><div class="feedback-title">✗ Incorrect</div><div class="feedback-text">driver.get is a method to navigate to a URL. current_url is an attribute of driver, not of driver.get. So 'driver.get.current_url' is invalid and causes AttributeError.</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 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">In a pytest Selenium test, how to correctly assert the page URL after navigation?</div><div>Given a pytest test function using Selenium WebDriver, which assertion correctly verifies the URL after navigating to 'https://example.com'?</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">import</span> pytest <span class="hl-kw">from</span> selenium <span class="hl-kw">import</span> webdriver <span class="hl-kw">from</span> selenium.webdriver.chrome.service <span class="hl-kw">import</span> Service @pytest.fixture <span class="hl-kw">def</span> driver(): service = Service(<span class="hl-str">'/path/to/chromedriver'</span>) driver = webdriver.Chrome(service=service) <span class="hl-kw">yield</span> driver driver.quit() <span class="hl-kw">def</span> test_example_url(driver): driver.get(<span class="hl-str">'https://example.com'</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 driver.current_url.contains('example.com')</span></div><div class="task-option "><span class="task-option-key">B</span><span class="text-pre-wrap">assert driver.current_url is 'https://example.com/'</span></div><div class="task-option "><span class="task-option-key">C</span><span class="text-pre-wrap">assert driver.current_url == 'https://example.com/'</span></div><div class="task-option "><span class="task-option-key">D</span><span class="text-pre-wrap">assert driver.current_url.equals('https://example.com/')</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">Use Python string equality operator for exact match in assertions.</div></div><div class="feedback-box incorrect d-none"><div class="feedback-title">✗ Incorrect</div><div class="feedback-text">Option C uses '==' which correctly compares strings. Option C uses 'is' which compares object identity, not string content, and is incorrect. Option C calls a non-existent method 'equals' on string. Option C calls a non-existent method 'contains' on string.</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<!-- -->. <!-- -->Which Selenium WebDriver property is used to get the title of the current web page?</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<!-- -->. <code>driver.current_url</code></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<!-- -->. <code>driver.page_source</code></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<!-- -->. <code>driver.title</code></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<!-- -->. <code>driver.get_title()</code></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 the purpose of <code>driver.title</code></h4>The <code>driver.title</code> property returns the title of the current page as a string.</li><li><h4>Step 2: Compare with other properties</h4><code>driver.page_source</code> returns the HTML source, <code>driver.current_url</code> returns the URL, and <code>driver.get_title()</code> is not a valid method in Selenium Python.</li><li><h4>Final Answer:</h4><strong>driver.title</strong> -> Option C</li><li><h4>Quick Check:</h4>Page title = driver.title [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 driver.title to get page title quickly [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">Confusing driver.title with driver.current_url</li><li class="ph-mistake-item mb-0">Using driver.get_title() which does not exist</li><li class="ph-mistake-item mb-0">Trying to get title from page_source</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 syntax to get the current page URL in Selenium Python?</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<!-- -->. <!-- -->url = driver.current_url</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<!-- -->. <!-- -->url = driver.get_current_url()</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<!-- -->. <!-- -->url = driver.url()</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<!-- -->. <!-- -->url = driver.getUrl</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: Recall the property for current URL</h4>In Selenium Python, <code>driver.current_url</code> is a property that returns the current page URL as a string.</li><li><h4>Step 2: Check syntax correctness</h4><code>driver.get_current_url()</code>, <code>driver.url()</code>, and <code>driver.getUrl</code> use invalid method names or syntax. Only <code>url = driver.current_url</code> is correct without parentheses.</li><li><h4>Final Answer:</h4><strong>url = driver.current_url</strong> -> Option A</li><li><h4>Quick Check:</h4>Current URL = driver.current_url [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>Remember current_url is a property, not a method [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 parentheses to current_url like a method</li><li class="ph-mistake-item mb-0">Using incorrect method names like get_current_url()</li><li class="ph-mistake-item mb-0">Trying to access URL via driver.url()</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 if the browser is currently on the page with title "Welcome Page" and URL "https://example.com/home"? <pre>print(driver.title) print(driver.current_url)</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<!-- -->. <!-- -->Welcome Page https://example.com/home</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<!-- -->. <!-- -->https://example.com/home Welcome Page</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<!-- -->. <!-- -->driver.title driver.current_url</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<!-- -->. <!-- -->Error: driver.title and driver.current_url are methods</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 what driver.title returns</h4><code>driver.title</code> returns the page title string, here "Welcome Page".</li><li><h4>Step 2: Understand what driver.current_url returns</h4><code>driver.current_url</code> returns the current URL string, here "https://example.com/home".</li><li><h4>Final Answer:</h4><strong>Welcome Page https://example.com/home</strong> -> Option A</li><li><h4>Quick Check:</h4>Title then URL printed 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>driver.title prints title; driver.current_url prints URL [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">Swapping title and URL order in output</li><li class="ph-mistake-item mb-0">Thinking driver.title/current_url are methods needing ()</li><li class="ph-mistake-item mb-0">Expecting variable names printed instead of values</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 the code below to print the page title and URL, but it raises an AttributeError. What is the mistake? <pre>print(driver.get_title()) print(driver.get_current_url())</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<!-- -->. <!-- -->You must import get_title and get_current_url from selenium</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.get_title() and driver.get_current_url() are not valid methods in Selenium Python</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<!-- -->. <!-- -->driver.title and driver.current_url are not accessible properties</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.title and driver.current_url need parentheses</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 method existence in Selenium Python</h4>There are no methods named <code>get_title()</code> or <code>get_current_url()</code> in Selenium Python WebDriver.</li><li><h4>Step 2: Use correct properties</h4>The correct way is to use <code>driver.title</code> and <code>driver.current_url</code> without parentheses as they are properties, not methods.</li><li><h4>Final Answer:</h4><strong>driver.get_title() and driver.get_current_url() are not valid methods in Selenium Python</strong> -> Option B</li><li><h4>Quick Check:</h4>Use properties, not get_ methods [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 driver.title and driver.current_url properties, no () [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">Calling driver.title() or driver.current_url() as methods</li><li class="ph-mistake-item mb-0">Trying to import non-existent get_title functions</li><li class="ph-mistake-item mb-0">Confusing Selenium Python with other language APIs</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 verify that after navigating to "https://example.com/login", the page title is exactly "Login Page" and the URL contains "/login". Which code snippet correctly performs these checks using Selenium Python?</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<!-- -->. <!-- -->assert driver.title == "Login Page" or driver.current_url == "/login"</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<!-- -->. <!-- -->assert driver.title() == "Login Page" and driver.current_url() == "/login"</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<!-- -->. <!-- -->assert driver.get_title() == "Login Page" and driver.get_current_url() == "/login"</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<!-- -->. <!-- -->assert driver.title == "Login Page" and "/login" in driver.current_url</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: Use correct properties and operators</h4>Use <code>driver.title</code> to get the page title and <code>driver.current_url</code> to get the URL. Use == to check exact title and 'in' to check substring in URL.</li><li><h4>Step 2: Understand assertion logic</h4>Use 'and' to ensure both conditions are true. assert driver.title == "Login Page" or driver.current_url == "/login" uses 'or' which passes if only one condition is true, not both.</li><li><h4>Final Answer:</h4><strong>assert driver.title == "Login Page" and "/login" in driver.current_url</strong> -> Option D</li><li><h4>Quick Check:</h4>Use properties and 'and' for combined checks [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 assert with driver.title and 'in' for URL substring [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">Calling title or current_url as methods</li><li class="ph-mistake-item mb-0">Using 'or' instead of 'and' in assertions</li><li class="ph-mistake-item mb-0">Checking URL equality instead of substring</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-1\",\"d\"]\n10:[\"pattern\",\"selenium-python-page-title-and-url-retrieval\",\"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-1/selenium-python-page-title-and-url-retrieval/challenge\",\"initialTree\":[\"\",{\"children\":[[\"lang\",\"en\",\"d\"],{\"children\":[\"codefly\",{\"children\":[\"learn\",{\"children\":[[\"subject\",\"selenium-python\",\"d\"],{\"children\":[[\"part\",\"part-1\",\"d\"],{\"children\":[[\"pattern\",\"selenium-python-page-title-and-url-retrieval\",\"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-1\",\"d\"],{\"children\":[[\"pattern\",\"selenium-python-page-title-and-url-retrieval\",\"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,"18:[[\"$\",\"meta\",\"0\",{\"name\":\"viewport\",\"content\":\"width=device-width, initial-scale=1\"}],[\"$\",\"meta\",\"1\",{\"charSet\":\"utf-8\"}],[\"$\",\"title\",\"2\",{\"children\":\"Page title and URL retrieval in Selenium Python Practice Problems - Coding Exercises | Leyaa.ai\"}],[\"$\",\"meta\",\"3\",{\"name\":\"description\",\"content\":\"Solve Page title and URL retrieval 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-1/selenium-python-page-title-and-url-retrieval/challenge\"}],[\"$\",\"link\",\"14\",{\"rel\":\"alternate\",\"hrefLang\":\"en\",\"href\":\"https://leyaa.ai/codefly/learn/selenium-python/part-1/selenium-python-page-title-and-url-retrieval/challenge\"}],[\"$\",\"link\",\"15\",{\"rel\":\"alternate\",\"hrefLang\":\"x-default\",\"href\":\"https://leyaa.ai/codefly/learn/selenium-python/part-1/selenium-python-page-title-and-url-retrieval/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\":\"Page title and URL retrieval in Selenium Python Practice Problems - Coding Exercises | Leyaa.ai\"}],[\"$\",\"meta\",\"20\",{\"property\":\"og:description\",\"content\":\"Solve Page title and URL retrieval 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-1/selenium-python-page-title-and-url-retrieval/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\":\"Page title and URL retrieval 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\":\"Page title and URL retrieval in Selenium Python Practice Problems - Coding Exercises | Leyaa.ai\"}],[\"$\",\"meta\",\"32\",{\"name\":\"twitter:description\",\"content\":\"Solve Page title and URL retrieval 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><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:T532,{\"@context\":\"https://schema.org\",\"@type\":\"LearningResource\",\"name\":\"Page title and URL retrieval in Selenium Python - Practice Problems \u0026 Coding Challenges\",\"description\":\"Solve Page title and URL retrieval 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-1/selenium-python-page-title-and-url-retrieval/challenge\",\"learningResourceType\":\"Quiz\",\"programmingLanguage\":\"Selenium Python\",\"inLanguage\":\"en\",\"isAccessibleForFree\":true,\"teaches\":\"Page title and URL retrieval in Selenium Python - Practice Problems \u0026 Coding Challenges\",\"provider\":{\"@type\":\"Organization\",\"url\":\"https://leyaa.ai\"},\"educationalLevel\":\"Beginner to Advanced\""])</script><script>self.__next_f.push([1,",\"breadcrumb\":{\"@type\":\"BreadcrumbList\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https://leyaa.ai\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Page title and URL retrieval in Selenium Python - Practice Problems \u0026 Coding Challenges\",\"item\":\"https://leyaa.ai/codefly/learn/selenium-python/part-1/selenium-python-page-title-and-url-retrieval\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Challenge\",\"item\":\"https://leyaa.ai/codefly/learn/selenium-python/part-1/selenium-python-page-title-and-url-retrieval/challenge\"}]}}"])</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-1\",\"pattern\":\"selenium_python_page_title_and_url_retrieval\",\"modeSlug\":\"challenge\",\"lang\":\"en\",\"internalLinks\":[{\"code\":\"LMC\",\"slug\":\"\",\"label\":\"📖 Learn\",\"href\":\"/codefly/learn/selenium-python/part-1/selenium-python-page-title-and-url-retrieval\",\"active\":false},{\"code\":\"LMCWHY\",\"slug\":\"why\",\"label\":\"💡 Why Learn This\",\"href\":\"/codefly/learn/selenium-python/part-1/selenium-python-page-title-and-url-retrieval/why\",\"active\":false},{\"code\":\"DLM\",\"slug\":\"deep\",\"label\":\"💡 Deep Learn Mode\",\"href\":\"/codefly/learn/selenium-python/part-1/selenium-python-page-title-and-url-retrieval/deep\",\"active\":false},{\"code\":\"TMC\",\"slug\":\"try\",\"label\":\"✏️ Try It\",\"href\":\"/codefly/learn/selenium-python/part-1/selenium-python-page-title-and-url-retrieval/try\",\"active\":false},{\"code\":\"VMC\",\"slug\":\"visualize\",\"label\":\"👁 Visualize\",\"href\":\"/codefly/learn/selenium-python/part-1/selenium-python-page-title-and-url-retrieval/visualize\",\"active\":false},{\"code\":\"TCM\",\"slug\":\"complexity\",\"label\":\"⏱ Complexity\",\"href\":\"/codefly/learn/selenium-python/part-1/selenium-python-page-title-and-url-retrieval/complexity\",\"active\":false},{\"code\":\"CMC\",\"slug\":\"challenge\",\"label\":\"🏆 Challenge\",\"href\":\"/codefly/learn/selenium-python/part-1/selenium-python-page-title-and-url-retrieval/challenge\",\"active\":true},{\"code\":\"PMC\",\"slug\":\"project\",\"label\":\"📁 Project\",\"href\":\"/codefly/learn/selenium-python/part-1/selenium-python-page-title-and-url-retrieval/project\",\"active\":false},{\"code\":\"RMC\",\"slug\":\"review\",\"label\":\"🧠 Quick Review\",\"href\":\"/codefly/learn/selenium-python/part-1/selenium-python-page-title-and-url-retrieval/review\",\"active\":false}],\"isLoggedIn\":false,\"seoH1\":\"Page title and URL retrieval in Selenium Python - Practice Problems \u0026 Coding Challenges\",\"contentData\":{\"pattern_id\":\"selenium_python_page_title_and_url_retrieval\",\"metadata\":{\"slot_map\":{\"LMCWHY\":\"LMCWHY\",\"LMC\":\"LMC\",\"TMC\":\"TMC\",\"CMC\":\"CMC\",\"RMC\":\"RMC\",\"VMC\":\"EXC\",\"TCM\":\"TFW\",\"PMC\":\"AUT\",\"DLM\":\"DLM\"}},\"modes\":{\"CMC\":{\"topic\":\"Page title and URL retrieval\",\"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 Python code snippet?\",\"prompt\":\"Consider the following Selenium code that opens a webpage and prints the title and current URL. What will be printed?\",\"code\":\"from selenium import webdriver\\nfrom selenium.webdriver.chrome.service import Service\\nfrom selenium.webdriver.common.by import By\\n\\nservice = Service('/path/to/chromedriver')\\ndriver = webdriver.Chrome(service=service)\\ndriver.get('https://example.com')\\nprint(driver.title)\\nprint(driver.current_url)\\ndriver.quit()\",\"ordering_targets\":[],\"options\":{\"A\":\"Example Domain\\nhttps://example.com/\",\"B\":\"Example Domain\\nhttps://www.example.com/\",\"C\":\"example domain\\nhttps://example.com\",\"D\":\"Example Domain\\nhttps://example.com\"},\"correct_answer\":[\"A\"],\"time_limit_seconds\":120,\"attempts_allowed\":2,\"hint\":\"Check the exact title text and URL format of https://example.com in a browser.\",\"explanation\":\"The page title of https://example.com is exactly 'Example Domain' with capital letters. The URL returned by driver.current_url includes the trailing slash, so it is 'https://example.com/'.\",\"solution\":\"The code prints the page title 'Example Domain' and the current URL 'https://example.com/'.\",\"tags\":[\"selenium\",\"page title\",\"current URL\",\"webdriver\"]},{\"id\":\"c2\",\"type\":\"assertion\",\"difficulty\":\"intermediate\",\"title\":\"Which assertion correctly verifies the page title after navigation?\",\"prompt\":\"You want to check that after navigating to 'https://example.com', the page title is exactly 'Example Domain'. Which assertion is correct?\",\"code\":\"from selenium import webdriver\\nfrom selenium.webdriver.chrome.service import Service\\n\\nservice = Service('/path/to/chromedriver')\\ndriver = webdriver.Chrome(service=service)\\ndriver.get('https://example.com')\\n\\n# Which assertion below is correct?\\n\",\"ordering_targets\":[],\"options\":{\"A\":\"assert driver.title == 'Example Domain'\",\"B\":\"assert driver.title = 'Example Domain'\",\"C\":\"assert driver.title.contains('Example Domain')\",\"D\":\"assert driver.title != 'Example Domain'\"},\"correct_answer\":[\"A\"],\"time_limit_seconds\":90,\"attempts_allowed\":2,\"hint\":\"Remember the syntax for equality comparison in Python assertions.\",\"explanation\":\"Option A uses the correct equality operator '==' to compare the title string. Option A uses assignment '=' which is invalid in assert. Option A asserts the opposite. Option A uses a method that does not exist on string objects.\",\"solution\":\"Use 'assert driver.title == \\\"Example Domain\\\"' to verify the page title.\",\"tags\":[\"assertion\",\"selenium\",\"page title\",\"python\"]},{\"id\":\"c3\",\"type\":\"locator\",\"difficulty\":\"advanced\",\"title\":\"Which locator strategy is best to retrieve the page title element for testing?\",\"prompt\":\"You want to locate the HTML element that contains the page title text on 'https://example.com' for validation. Which locator is best?\",\"code\":\"\",\"ordering_targets\":[],\"options\":{\"A\":\"driver.find_element(By.ID, 'title')\",\"B\":\"driver.find_element(By.TAG_NAME, 'title')\",\"C\":\"driver.find_element(By.CLASS_NAME, 'title')\",\"D\":\"driver.find_element(By.CSS_SELECTOR, 'head \u003e title')\"},\"correct_answer\":[\"B\"],\"time_limit_seconds\":120,\"attempts_allowed\":2,\"hint\":\"The page title is inside the \u003ctitle\u003e tag in the \u003chead\u003e section.\",\"explanation\":\"The \u003ctitle\u003e tag is a unique tag inside \u003chead\u003e. Using By.TAG_NAME with 'title' correctly locates it. The other options look for id or class which do not exist on the \u003ctitle\u003e tag. CSS selector 'head \u003e title' is valid but Selenium does not support locating \u003ctitle\u003e reliably with CSS selectors.\",\"solution\":\"Use 'driver.find_element(By.TAG_NAME, \\\"title\\\")' to get the page title element.\",\"tags\":[\"selenium\",\"locator\",\"page title\",\"html\"]},{\"id\":\"c4\",\"type\":\"debug\",\"difficulty\":\"advanced\",\"title\":\"Why does this Selenium code fail to get the current URL?\",\"prompt\":\"This code snippet throws an AttributeError. Identify the cause.\",\"code\":\"from selenium import webdriver\\nfrom selenium.webdriver.chrome.service import Service\\n\\nservice = Service('/path/to/chromedriver')\\ndriver = webdriver.Chrome(service=service)\\ndriver.get('https://example.com')\\nurl = driver.get.current_url\\nprint(url)\\ndriver.quit()\",\"ordering_targets\":[],\"options\":{\"A\":\"'driver.get' returns None, so accessing 'current_url' fails\",\"B\":\"'current_url' is a method and needs parentheses\",\"C\":\"'driver' object has no attribute 'get'\",\"D\":\"'get' is a method, not an object; 'current_url' is an attribute of driver, not driver.get\"},\"correct_answer\":[\"D\"],\"time_limit_seconds\":150,\"attempts_allowed\":2,\"hint\":\"Check the difference between methods and attributes on the driver object.\",\"explanation\":\"driver.get is a method to navigate to a URL. current_url is an attribute of driver, not of driver.get. So 'driver.get.current_url' is invalid and causes AttributeError.\",\"solution\":\"Use 'driver.current_url' to get the current URL, not 'driver.get.current_url'.\",\"tags\":[\"selenium\",\"debugging\",\"attribute error\",\"python\"]},{\"id\":\"c5\",\"type\":\"framework\",\"difficulty\":\"expert\",\"title\":\"In a pytest Selenium test, how to correctly assert the page URL after navigation?\",\"prompt\":\"Given a pytest test function using Selenium WebDriver, which assertion correctly verifies the URL after navigating to 'https://example.com'?\",\"code\":\"import pytest\\nfrom selenium import webdriver\\nfrom selenium.webdriver.chrome.service import Service\\n\\n@pytest.fixture\\ndef driver():\\n service = Service('/path/to/chromedriver')\\n driver = webdriver.Chrome(service=service)\\n yield driver\\n driver.quit()\\n\\n\\ndef test_example_url(driver):\\n driver.get('https://example.com')\\n # Which assertion below is correct?\\n\",\"ordering_targets\":[],\"options\":{\"A\":\"assert driver.current_url.contains('example.com')\",\"B\":\"assert driver.current_url is 'https://example.com/'\",\"C\":\"assert driver.current_url == 'https://example.com/'\",\"D\":\"assert driver.current_url.equals('https://example.com/')\"},\"correct_answer\":[\"C\"],\"time_limit_seconds\":180,\"attempts_allowed\":2,\"hint\":\"Use Python string equality operator for exact match in assertions.\",\"explanation\":\"Option C uses '==' which correctly compares strings. Option C uses 'is' which compares object identity, not string content, and is incorrect. Option C calls a non-existent method 'equals' on string. Option C calls a non-existent method 'contains' on string.\",\"solution\":\"Use 'assert driver.current_url == \\\"https://example.com/\\\"' in pytest tests to verify URL.\",\"tags\":[\"pytest\",\"selenium\",\"assertion\",\"url\"]}],\"achievement_badge\":{\"name\":\"Page Title \u0026 URL Master\",\"condition\":\"complete_all_5\"},\"metadata\":{\"version\":\"4.2\",\"content_type\":\"testing\",\"total_challenges\":5,\"estimated_time_minutes\":20}}},\"subject\":\"selenium_python\",\"title\":\"Page title and URL retrieval\",\"puzzleDetails\":[{\"_id\":\"69b1786a45baa2b585489cbd\",\"question_number\":1,\"question\":\"Which Selenium WebDriver property is used to get the title of the current web page?\",\"options\":{\"A\":\"\u003ccode\u003edriver.current_url\u003c/code\u003e\",\"B\":\"\u003ccode\u003edriver.page_source\u003c/code\u003e\",\"C\":\"\u003ccode\u003edriver.title\u003c/code\u003e\",\"D\":\"\u003ccode\u003edriver.get_title()\u003c/code\u003e\"},\"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 the purpose of \u003ccode\u003edriver.title\u003c/code\u003e\u003c/h4\u003eThe \u003ccode\u003edriver.title\u003c/code\u003e property returns the title of the current page as a string.\u003c/li\u003e\u003cli\u003e\u003ch4\u003eStep 2: Compare with other properties\u003c/h4\u003e\u003ccode\u003edriver.page_source\u003c/code\u003e returns the HTML source, \u003ccode\u003edriver.current_url\u003c/code\u003e returns the URL, and \u003ccode\u003edriver.get_title()\u003c/code\u003e is not a valid method in Selenium Python.\u003c/li\u003e\u003cli\u003e\u003ch4\u003eFinal Answer:\u003c/h4\u003e\u003cstrong\u003edriver.title\u003c/strong\u003e -\u003e Option C\u003c/li\u003e\u003cli\u003e\u003ch4\u003eQuick Check:\u003c/h4\u003ePage title = driver.title [OK]\u003c/li\u003e\u003c/ol\u003e\u003c/div\u003e\",\"quick_trick\":\"Use driver.title to get page title quickly [OK]\",\"common_mistakes\":[\"Confusing driver.title with driver.current_url\",\"Using driver.get_title() which does not exist\",\"Trying to get title from page_source\"],\"subject\":\"selenium_python\",\"pattern\":\"Page title and URL retrieval\",\"category\":\"Software Testing \u0026 QA\",\"question_format\":\"MCQ\",\"question_mode\":\"conceptual\",\"difficulty\":\"easy\",\"topic\":\"Browser Navigation\",\"type\":\"Software Testing \u0026 QA\",\"question_type\":\"conceptual\",\"level\":\"easy\",\"test_type\":\"puzzle\",\"pattern_id\":\"selenium_python_page_title_and_url_retrieval\",\"subjectTitle\":\"Selenium Python\",\"part\":\"part-1\",\"set_no\":1,\"usage_count\":0,\"topic_id\":\"selenium_python_p1_t2\"},{\"_id\":\"69b1786a45baa2b585489cbe\",\"question_number\":2,\"question\":\"Which of the following is the correct syntax to get the current page URL in Selenium Python?\",\"options\":{\"A\":\"url = driver.current_url\",\"B\":\"url = driver.get_current_url()\",\"C\":\"url = driver.url()\",\"D\":\"url = driver.getUrl\"},\"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: Recall the property for current URL\u003c/h4\u003eIn Selenium Python, \u003ccode\u003edriver.current_url\u003c/code\u003e is a property that returns the current page URL as a string.\u003c/li\u003e\u003cli\u003e\u003ch4\u003eStep 2: Check syntax correctness\u003c/h4\u003e\u003ccode\u003edriver.get_current_url()\u003c/code\u003e, \u003ccode\u003edriver.url()\u003c/code\u003e, and \u003ccode\u003edriver.getUrl\u003c/code\u003e use invalid method names or syntax. Only \u003ccode\u003eurl = driver.current_url\u003c/code\u003e is correct without parentheses.\u003c/li\u003e\u003cli\u003e\u003ch4\u003eFinal Answer:\u003c/h4\u003e\u003cstrong\u003eurl = driver.current_url\u003c/strong\u003e -\u003e Option A\u003c/li\u003e\u003cli\u003e\u003ch4\u003eQuick Check:\u003c/h4\u003eCurrent URL = driver.current_url [OK]\u003c/li\u003e\u003c/ol\u003e\u003c/div\u003e\",\"quick_trick\":\"Remember current_url is a property, not a method [OK]\",\"common_mistakes\":[\"Adding parentheses to current_url like a method\",\"Using incorrect method names like get_current_url()\",\"Trying to access URL via driver.url()\"],\"subject\":\"selenium_python\",\"pattern\":\"Page title and URL retrieval\",\"category\":\"Software Testing \u0026 QA\",\"question_format\":\"MCQ\",\"question_mode\":\"syntax\",\"difficulty\":\"easy\",\"topic\":\"Browser Navigation\",\"type\":\"Software Testing \u0026 QA\",\"question_type\":\"syntax\",\"level\":\"easy\",\"test_type\":\"puzzle\",\"pattern_id\":\"selenium_python_page_title_and_url_retrieval\",\"subjectTitle\":\"Selenium Python\",\"part\":\"part-1\",\"set_no\":1,\"usage_count\":0,\"topic_id\":\"selenium_python_p1_t2\"},{\"_id\":\"69b1786a45baa2b585489cbf\",\"question_number\":3,\"question\":\"What will be the output of the following code snippet if the browser is currently on the page with title \\\"Welcome Page\\\" and URL \\\"https://example.com/home\\\"?\\n\\n\u003cpre\u003eprint(driver.title)\\nprint(driver.current_url)\u003c/pre\u003e\",\"options\":{\"A\":\"Welcome Page\\nhttps://example.com/home\",\"B\":\"https://example.com/home\\nWelcome Page\",\"C\":\"driver.title\\ndriver.current_url\",\"D\":\"Error: driver.title and driver.current_url are methods\"},\"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: Understand what driver.title returns\u003c/h4\u003e\u003ccode\u003edriver.title\u003c/code\u003e returns the page title string, here \\\"Welcome Page\\\".\u003c/li\u003e\u003cli\u003e\u003ch4\u003eStep 2: Understand what driver.current_url returns\u003c/h4\u003e\u003ccode\u003edriver.current_url\u003c/code\u003e returns the current URL string, here \\\"https://example.com/home\\\".\u003c/li\u003e\u003cli\u003e\u003ch4\u003eFinal Answer:\u003c/h4\u003e\u003cstrong\u003eWelcome Page\\nhttps://example.com/home\u003c/strong\u003e -\u003e Option A\u003c/li\u003e\u003cli\u003e\u003ch4\u003eQuick Check:\u003c/h4\u003eTitle then URL printed correctly [OK]\u003c/li\u003e\u003c/ol\u003e\u003c/div\u003e\",\"quick_trick\":\"driver.title prints title; driver.current_url prints URL [OK]\",\"common_mistakes\":[\"Swapping title and URL order in output\",\"Thinking driver.title/current_url are methods needing ()\",\"Expecting variable names printed instead of values\"],\"subject\":\"selenium_python\",\"pattern\":\"Page title and URL retrieval\",\"category\":\"Software Testing \u0026 QA\",\"question_format\":\"MCQ\",\"question_mode\":\"code_output\",\"difficulty\":\"medium\",\"topic\":\"Browser Navigation\",\"type\":\"Software Testing \u0026 QA\",\"question_type\":\"code_output\",\"level\":\"medium\",\"test_type\":\"puzzle\",\"pattern_id\":\"selenium_python_page_title_and_url_retrieval\",\"subjectTitle\":\"Selenium Python\",\"part\":\"part-1\",\"set_no\":1,\"usage_count\":0,\"topic_id\":\"selenium_python_p1_t2\"},{\"_id\":\"69b1786a45baa2b585489cc0\",\"question_number\":4,\"question\":\"You wrote the code below to print the page title and URL, but it raises an AttributeError. What is the mistake?\\n\\n\u003cpre\u003eprint(driver.get_title())\\nprint(driver.get_current_url())\u003c/pre\u003e\",\"options\":{\"A\":\"You must import get_title and get_current_url from selenium\",\"B\":\"driver.get_title() and driver.get_current_url() are not valid methods in Selenium Python\",\"C\":\"driver.title and driver.current_url are not accessible properties\",\"D\":\"driver.title and driver.current_url need parentheses\"},\"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 method existence in Selenium Python\u003c/h4\u003eThere are no methods named \u003ccode\u003eget_title()\u003c/code\u003e or \u003ccode\u003eget_current_url()\u003c/code\u003e in Selenium Python WebDriver.\u003c/li\u003e\u003cli\u003e\u003ch4\u003eStep 2: Use correct properties\u003c/h4\u003eThe correct way is to use \u003ccode\u003edriver.title\u003c/code\u003e and \u003ccode\u003edriver.current_url\u003c/code\u003e without parentheses as they are properties, not methods.\u003c/li\u003e\u003cli\u003e\u003ch4\u003eFinal Answer:\u003c/h4\u003e\u003cstrong\u003edriver.get_title() and driver.get_current_url() are not valid methods in Selenium Python\u003c/strong\u003e -\u003e Option B\u003c/li\u003e\u003cli\u003e\u003ch4\u003eQuick Check:\u003c/h4\u003eUse properties, not get_ methods [OK]\u003c/li\u003e\u003c/ol\u003e\u003c/div\u003e\",\"quick_trick\":\"Use driver.title and driver.current_url properties, no () [OK]\",\"common_mistakes\":[\"Calling driver.title() or driver.current_url() as methods\",\"Trying to import non-existent get_title functions\",\"Confusing Selenium Python with other language APIs\"],\"subject\":\"selenium_python\",\"pattern\":\"Page title and URL retrieval\",\"category\":\"Software Testing \u0026 QA\",\"question_format\":\"MCQ\",\"question_mode\":\"debug\",\"difficulty\":\"medium\",\"topic\":\"Browser Navigation\",\"type\":\"Software Testing \u0026 QA\",\"question_type\":\"debug\",\"level\":\"medium\",\"test_type\":\"puzzle\",\"pattern_id\":\"selenium_python_page_title_and_url_retrieval\",\"subjectTitle\":\"Selenium Python\",\"part\":\"part-1\",\"set_no\":1,\"usage_count\":0,\"topic_id\":\"selenium_python_p1_t2\"},{\"_id\":\"69b1786a45baa2b585489cc1\",\"question_number\":5,\"question\":\"You want to verify that after navigating to \\\"https://example.com/login\\\", the page title is exactly \\\"Login Page\\\" and the URL contains \\\"/login\\\". Which code snippet correctly performs these checks using Selenium Python?\",\"options\":{\"A\":\"assert driver.title == \\\"Login Page\\\" or driver.current_url == \\\"/login\\\"\",\"B\":\"assert driver.title() == \\\"Login Page\\\" and driver.current_url() == \\\"/login\\\"\",\"C\":\"assert driver.get_title() == \\\"Login Page\\\" and driver.get_current_url() == \\\"/login\\\"\",\"D\":\"assert driver.title == \\\"Login Page\\\" and \\\"/login\\\" in driver.current_url\"},\"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: Use correct properties and operators\u003c/h4\u003eUse \u003ccode\u003edriver.title\u003c/code\u003e to get the page title and \u003ccode\u003edriver.current_url\u003c/code\u003e to get the URL. Use == to check exact title and 'in' to check substring in URL.\u003c/li\u003e\u003cli\u003e\u003ch4\u003eStep 2: Understand assertion logic\u003c/h4\u003eUse 'and' to ensure both conditions are true. assert driver.title == \\\"Login Page\\\" or driver.current_url == \\\"/login\\\" uses 'or' which passes if only one condition is true, not both.\u003c/li\u003e\u003cli\u003e\u003ch4\u003eFinal Answer:\u003c/h4\u003e\u003cstrong\u003eassert driver.title == \\\"Login Page\\\" and \\\"/login\\\" in driver.current_url\u003c/strong\u003e -\u003e Option D\u003c/li\u003e\u003cli\u003e\u003ch4\u003eQuick Check:\u003c/h4\u003eUse properties and 'and' for combined checks [OK]\u003c/li\u003e\u003c/ol\u003e\u003c/div\u003e\",\"quick_trick\":\"Use assert with driver.title and 'in' for URL substring [OK]\",\"common_mistakes\":[\"Calling title or current_url as methods\",\"Using 'or' instead of 'and' in assertions\",\"Checking URL equality instead of substring\"],\"subject\":\"selenium_python\",\"pattern\":\"Page title and URL retrieval\",\"category\":\"Software Testing \u0026 QA\",\"question_format\":\"MCQ\",\"question_mode\":\"application\",\"difficulty\":\"hard\",\"topic\":\"Browser Navigation\",\"type\":\"Software Testing \u0026 QA\",\"question_type\":\"application\",\"level\":\"hard\",\"test_type\":\"puzzle\",\"pattern_id\":\"selenium_python_page_title_and_url_retrieval\",\"subjectTitle\":\"Selenium Python\",\"part\":\"part-1\",\"set_no\":1,\"usage_count\":0,\"topic_id\":\"selenium_python_p1_t2\"}]},\"syllabusData\":{\"part\":\"part-1\",\"subject\":\"selenium_python\",\"difficulty\":\"beginner\",\"metadata\":{\"total_topics\":6,\"total_patterns\":50,\"patterns_with_content\":50,\"created_at\":\"2026-03-03T15:53:15.727324Z\",\"version\":\"4.2\",\"upload_tool\":\"upload_to_mongo.py v2.0\"},\"part_title\":\"Foundations\",\"subjectTitle\":\"Selenium Python\",\"topics\":[{\"topic_id\":\"selenium_python_p1_t1\",\"title\":\"Selenium Basics and Setup\",\"order\":1,\"pattern_count\":7,\"patterns\":[{\"pattern_id\":\"selenium_python_why_selenium_is_the_standard_for_web_automation\",\"title\":\"Why Selenium is the standard for web automation\",\"order\":1,\"has_content\":true},{\"pattern_id\":\"selenium_python_selenium_components_webdriver_grid_ide\",\"title\":\"Selenium components (WebDriver, Grid, IDE)\",\"order\":2,\"has_content\":true},{\"pattern_id\":\"selenium_python_selenium_vs_cypress_vs_playwright_comparison\",\"title\":\"Selenium vs Cypress vs Playwright comparison\",\"order\":3,\"has_content\":true},{\"pattern_id\":\"selenium_python_python_environment_setup\",\"title\":\"Python environment setup\",\"order\":4,\"has_content\":true},{\"pattern_id\":\"selenium_python_selenium_installation_pip_install_selenium\",\"title\":\"Selenium installation (pip install selenium)\",\"order\":5,\"has_content\":true},{\"pattern_id\":\"selenium_python_webdriver_setup_chromedriver_geckodriver\",\"title\":\"WebDriver setup (ChromeDriver, GeckoDriver)\",\"order\":6,\"has_content\":true},{\"pattern_id\":\"selenium_python_first_selenium_script\",\"title\":\"First Selenium script\",\"order\":7,\"has_content\":true}]},{\"topic_id\":\"selenium_python_p1_t2\",\"title\":\"Browser Navigation\",\"order\":2,\"pattern_count\":7,\"patterns\":[{\"pattern_id\":\"selenium_python_why_browser_control_is_the_foundation\",\"title\":\"Why browser control is the foundation\",\"order\":1,\"has_content\":true},{\"pattern_id\":\"selenium_python_opening_urls_get\",\"title\":\"Opening URLs (get)\",\"order\":2,\"has_content\":true},{\"pattern_id\":\"selenium_python_page_title_and_url_retrieval\",\"title\":\"Page title and URL retrieval\",\"order\":3,\"has_content\":true},{\"pattern_id\":\"selenium_python_back_forward_and_refresh\",\"title\":\"Back, forward, and refresh\",\"order\":4,\"has_content\":true},{\"pattern_id\":\"selenium_python_maximize_and_minimize_window\",\"title\":\"Maximize and minimize window\",\"order\":5,\"has_content\":true},{\"pattern_id\":\"selenium_python_window_size_control\",\"title\":\"Window size control\",\"order\":6,\"has_content\":true},{\"pattern_id\":\"selenium_python_closing_browser_close_vs_quit\",\"title\":\"Closing browser (close vs quit)\",\"order\":7,\"has_content\":true}]},{\"topic_id\":\"selenium_python_p1_t3\",\"title\":\"Locating Elements\",\"order\":3,\"pattern_count\":10,\"patterns\":[{\"pattern_id\":\"selenium_python_why_element_location_is_the_core_skill\",\"title\":\"Why element location is the core skill\",\"order\":1,\"has_content\":true},{\"pattern_id\":\"selenium_python_find_element_by_id\",\"title\":\"Find element by ID\",\"order\":2,\"has_content\":true},{\"pattern_id\":\"selenium_python_find_element_by_name\",\"title\":\"Find element by name\",\"order\":3,\"has_content\":true},{\"pattern_id\":\"selenium_python_find_element_by_class_name\",\"title\":\"Find element by class name\",\"order\":4,\"has_content\":true},{\"pattern_id\":\"selenium_python_find_element_by_tag_name\",\"title\":\"Find element by tag name\",\"order\":5,\"has_content\":true},{\"pattern_id\":\"selenium_python_find_element_by_link_text\",\"title\":\"Find element by link text\",\"order\":6,\"has_content\":true},{\"pattern_id\":\"selenium_python_find_element_by_partial_link_text\",\"title\":\"Find element by partial link text\",\"order\":7,\"has_content\":true},{\"pattern_id\":\"selenium_python_find_element_by_css_selector\",\"title\":\"Find element by CSS selector\",\"order\":8,\"has_content\":true},{\"pattern_id\":\"selenium_python_find_element_by_xpath\",\"title\":\"Find element by XPath\",\"order\":9,\"has_content\":true},{\"pattern_id\":\"selenium_python_finding_multiple_elements\",\"title\":\"Finding multiple elements\",\"order\":10,\"has_content\":true}]},{\"topic_id\":\"selenium_python_p1_t4\",\"title\":\"XPath and CSS Selectors\",\"order\":4,\"pattern_count\":9,\"patterns\":[{\"pattern_id\":\"selenium_python_why_mastering_selectors_ensures_reliability\",\"title\":\"Why mastering selectors ensures reliability\",\"order\":1,\"has_content\":true},{\"pattern_id\":\"selenium_python_absolute_vs_relative_xpath\",\"title\":\"Absolute vs relative XPath\",\"order\":2,\"has_content\":true},{\"pattern_id\":\"selenium_python_xpath_with_attributes\",\"title\":\"XPath with attributes\",\"order\":3,\"has_content\":true},{\"pattern_id\":\"selenium_python_xpath_with_text\",\"title\":\"XPath with text()\",\"order\":4,\"has_content\":true},{\"pattern_id\":\"selenium_python_xpath_axes_parent_child_sibling\",\"title\":\"XPath axes (parent, child, sibling)\",\"order\":5,\"has_content\":true},{\"pattern_id\":\"selenium_python_xpath_with_contains_and_startswith\",\"title\":\"XPath with contains and starts-with\",\"order\":6,\"has_content\":true},{\"pattern_id\":\"selenium_python_css_selector_syntax\",\"title\":\"CSS selector syntax\",\"order\":7,\"has_content\":true},{\"pattern_id\":\"selenium_python_css_attribute_selectors\",\"title\":\"CSS attribute selectors\",\"order\":8,\"has_content\":true},{\"pattern_id\":\"selenium_python_css_pseudoclasses_for_selection\",\"title\":\"CSS pseudo-classes for selection\",\"order\":9,\"has_content\":true}]},{\"topic_id\":\"selenium_python_p1_t5\",\"title\":\"Interacting with Elements\",\"order\":5,\"pattern_count\":9,\"patterns\":[{\"pattern_id\":\"selenium_python_why_element_interaction_drives_test_scenarios\",\"title\":\"Why element interaction drives test scenarios\",\"order\":1,\"has_content\":true},{\"pattern_id\":\"selenium_python_click_actions\",\"title\":\"Click actions\",\"order\":2,\"has_content\":true},{\"pattern_id\":\"selenium_python_typing_text_send_keys\",\"title\":\"Typing text (send_keys)\",\"order\":3,\"has_content\":true},{\"pattern_id\":\"selenium_python_clearing_input_fields\",\"title\":\"Clearing input fields\",\"order\":4,\"has_content\":true},{\"pattern_id\":\"selenium_python_submitting_forms\",\"title\":\"Submitting forms\",\"order\":5,\"has_content\":true},{\"pattern_id\":\"selenium_python_getting_element_text\",\"title\":\"Getting element text\",\"order\":6,\"has_content\":true},{\"pattern_id\":\"selenium_python_getting_element_attributes\",\"title\":\"Getting element attributes\",\"order\":7,\"has_content\":true},{\"pattern_id\":\"selenium_python_checking_element_state_displayed_enabled_selected\",\"title\":\"Checking element state (displayed, enabled, selected)\",\"order\":8,\"has_content\":true},{\"pattern_id\":\"selenium_python_element_screenshot\",\"title\":\"Element screenshot\",\"order\":9,\"has_content\":true}]},{\"topic_id\":\"selenium_python_p1_t6\",\"title\":\"Waits and Synchronization\",\"order\":6,\"pattern_count\":8,\"patterns\":[{\"pattern_id\":\"selenium_python_why_synchronization_prevents_flaky_tests\",\"title\":\"Why synchronization prevents flaky tests\",\"order\":1,\"has_content\":true},{\"pattern_id\":\"selenium_python_implicit_waits\",\"title\":\"Implicit waits\",\"order\":2,\"has_content\":true},{\"pattern_id\":\"selenium_python_explicit_waits_webdriverwait\",\"title\":\"Explicit waits (WebDriverWait)\",\"order\":3,\"has_content\":true},{\"pattern_id\":\"selenium_python_expected_conditions\",\"title\":\"Expected conditions\",\"order\":4,\"has_content\":true},{\"pattern_id\":\"selenium_python_fluent_waits\",\"title\":\"Fluent waits\",\"order\":5,\"has_content\":true},{\"pattern_id\":\"selenium_python_custom_wait_conditions\",\"title\":\"Custom wait conditions\",\"order\":6,\"has_content\":true},{\"pattern_id\":\"selenium_python_timesleep_vs_proper_waits\",\"title\":\"Time.sleep vs proper waits\",\"order\":7,\"has_content\":true},{\"pattern_id\":\"selenium_python_staleelementreferenceexception_handling\",\"title\":\"StaleElementReferenceException handling\",\"order\":8,\"has_content\":true}]}]},\"modeCode\":\"CMC\",\"productId\":\"codefly\"}]]\n"])</script></body></html>