Complete the code to click a button using Selenium.
button = driver.find_element(By.ID, '[1]') button.click()
The button with ID 'submit-btn' is the correct element to click for submitting the form.
Complete the code to enter text into a username field.
username_field = driver.find_element(By.NAME, '[1]') username_field.send_keys('testuser')
The 'username' name attribute identifies the input field for the username where text should be entered.
Fix the error in the code to correctly find a checkbox by its CSS selector.
checkbox = driver.find_element(By.CSS_SELECTOR, '[1]') checkbox.click()
The correct CSS selector to find all checkbox inputs is "input[type='checkbox']" without extra tags or IDs.
Fill both blanks to select a dropdown option by visible text.
from selenium.webdriver.support.ui import Select select_element = Select(driver.find_element(By.[1], '[2]')) select_element.select_by_visible_text('Option 1')
The dropdown is located by its name attribute 'dropdown-menu', so By.NAME and 'dropdown-menu' are used.
Fill all three blanks to assert the page title contains expected text after clicking a link.
link = driver.find_element(By.[1], '[2]') link.click() assert '[3]' in driver.title
The link is found by its full link text 'Home Page' using By.LINK_TEXT, and after clicking, the title should contain 'Welcome'.