0
0
Selenium Pythontesting~10 mins

Selenium vs Cypress vs Playwright comparison in Selenium Python - Interactive Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to open a browser using Selenium WebDriver.

Selenium Python
from selenium import webdriver

driver = webdriver.[1]()
driver.get('https://example.com')
driver.quit()
Drag options to blanks, or click blank then click option'
AFirefox
BSafari
CChrome
DEdge
Attempts:
3 left
💡 Hint
Common Mistakes
Using lowercase browser names
Forgetting to import webdriver
Not calling the constructor with parentheses
2fill in blank
medium

Complete the code to find an element by its ID using Selenium.

Selenium Python
element = driver.find_element_by_[1]('submit-button')
Drag options to blanks, or click blank then click option'
Aid
Bname
Cclass_name
Dtag_name
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'name' instead of 'id'
Using 'class_name' when ID is needed
Misspelling the method name
3fill in blank
hard

Fix the error in the assertion to check the page title with Selenium.

Selenium Python
assert driver.title [1] 'Example Domain'
Drag options to blanks, or click blank then click option'
A<
B==
C!=
D>
Attempts:
3 left
💡 Hint
Common Mistakes
Using '!=' which checks for inequality
Using comparison operators like '<' or '>' incorrectly
4fill in blank
hard

Fill both blanks to create a test that waits for an element to be clickable using Selenium's WebDriverWait.

Selenium Python
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC

wait = WebDriverWait(driver, 10)
element = wait.until(EC.[1]((By.[2], 'submit-button')))
Drag options to blanks, or click blank then click option'
Aelement_to_be_clickable
Bpresence_of_element_located
CID
DCLASS_NAME
Attempts:
3 left
💡 Hint
Common Mistakes
Using presence_of_element_located which only checks presence
Using wrong locator types like CLASS_NAME when ID is needed
5fill in blank
hard

Fill both blanks to create a dictionary comprehension that maps test names to their pass status from a results dictionary.

Selenium Python
test_status = {test[1]: result for test, result in results.items() if result [2] True}
Drag options to blanks, or click blank then click option'
A.upper()
C==
D!=
Attempts:
3 left
💡 Hint
Common Mistakes
Using '!=' instead of '==' in the condition
Modifying result values incorrectly
Not applying string method to test names