Complete the code to import the Selenium WebDriver module.
from selenium import [1]
The webdriver module is imported from Selenium to control browsers.
Complete the code to initialize the Chrome WebDriver in the test setup method.
def setup_method(self): self.driver = [1]()
To open Chrome browser, use webdriver.Chrome().
Fix the error in the test method to correctly assert the page title.
def test_title(self): self.driver.get('https://example.com') assert self.driver.title [1] 'Example Domain'
To check if the page title matches exactly, use the equality operator ==.
Fill both blanks to create a page object method that returns the login button element.
def get_login_button(self): return self.driver.find_element([1], [2])
The find_element method requires a locator strategy and a locator value. Use By.ID and the string "login-button" without quotes around the locator variable.
Fill all three blanks to create a test method that uses the page object to click the login button and assert the URL.
def test_login_button(self): page = LoginPage(self.driver) page.[1]() assert self.driver.current_url [2] 'https://example.com/dashboard' self.driver.[3]()
The test calls the page object's click_login_button() method, asserts the URL equals the dashboard URL, and then closes the browser with quit().