Complete the code to start a simple automated test using Selenium WebDriver in Python.
from selenium import webdriver driver = webdriver.Chrome() driver.get([1]) driver.quit()
The URL must be a string enclosed in quotes. Option B correctly uses quotes around the URL.
Complete the code to assert that the page title contains the word 'Example'.
assert 'Example' [1] driver.title
The 'in' keyword checks if 'Example' is part of the page title string.
Fix the error in the Selenium test code to correctly find an element by its ID.
element = driver.find_element_by_[1]('submit-button')
The correct method to find an element by its ID uses 'id' as the locator type.
Complete the code to create a dictionary comprehension that maps test names to their pass status if the status is True.
passed_tests = {test: status for test, status in test_results.items() if status [1] True}Use ':' to map keys to values in a dictionary comprehension and '==' to check if status is True.
Fill all three blanks to create a filtered dictionary of tests with duration greater than 5 seconds.
slow_tests = { [1] : [2] for [3], [2] in tests.items() if [2] > 5 }The dictionary comprehension maps test_name to duration for tests where duration is greater than 5.