Complete the code to start a remote WebDriver session using Selenium Grid.
from selenium import webdriver from selenium.webdriver.common.desired_capabilities import DesiredCapabilities driver = webdriver.Remote( command_executor='http://localhost:4444/wd/hub', desired_capabilities=DesiredCapabilities.[1] )
The correct capability to start a Chrome browser session on Selenium Grid is DesiredCapabilities.CHROME.
Complete the code to specify the Selenium Grid hub URL correctly.
hub_url = 'http://[1]:4444/wd/hub' driver = webdriver.Remote( command_executor=hub_url, desired_capabilities=DesiredCapabilities.CHROME )
The Selenium Grid hub URL commonly uses localhost when running locally.
Fix the error in the code to correctly import the Selenium WebDriver module for remote execution.
from selenium import [1] driver = webdriver.Remote( command_executor='http://localhost:4444/wd/hub', desired_capabilities=DesiredCapabilities.CHROME )
remote or webdriver_remote.The correct import to use Selenium WebDriver is from selenium import webdriver.
Fill both blanks to create a dictionary comprehension that filters nodes with status 'ready' and extracts their names.
ready_nodes = {node['name']: node for node in nodes if node[1]'status' == '[2]'}To access dictionary keys, use square brackets with quotes: node['status'].
Fill all three blanks to create a test assertion that checks if the page title contains the word 'Dashboard'.
assert '[1]' in driver.title, 'Page title does not contain [2]' print('Test [3]')
The assertion checks if 'Dashboard' is in the page title and prints 'Test passed' if true.