0
0
Selenium Pythontesting~10 mins

Why evidence collection supports debugging in Selenium Python - Test Your Understanding

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

Complete the code to capture a screenshot during a Selenium test.

Selenium Python
driver.[1]('screenshot.png')
Drag options to blanks, or click blank then click option'
Atake_screenshot
Bsave_screenshot
Ccapture_screen
Dget_screenshot
Attempts:
3 left
💡 Hint
Common Mistakes
Using a non-existent method like get_screenshot or capture_screen.
2fill in blank
medium

Complete the code to get the current page source for debugging.

Selenium Python
page_source = driver.[1]
Drag options to blanks, or click blank then click option'
Apage_source
Bsource_code
Chtml_source
Dpage_html
Attempts:
3 left
💡 Hint
Common Mistakes
Using incorrect property names like page_html or source_code.
3fill in blank
hard

Fix the error in the code to save browser logs for debugging.

Selenium Python
logs = driver.get_log('[1]')
Drag options to blanks, or click blank then click option'
Alog
Bconsole
Cbrowser
Ddebug
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'console' or 'log' which are invalid log types.
4fill in blank
hard

Fill both blanks to wait until an element is visible before interacting.

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'
Avisibility_of_element_located
Bpresence_of_element_located
CID
DCLASS_NAME
Attempts:
3 left
💡 Hint
Common Mistakes
Using presence_of_element_located which does not guarantee visibility.
Using CLASS_NAME when the locator is an ID.
5fill in blank
hard

Fill all three blanks to collect a screenshot, page source, and browser logs for debugging.

Selenium Python
driver.[1]('debug.png')
source = driver.[2]
logs = driver.get_log('[3]')
Drag options to blanks, or click blank then click option'
Asave_screenshot
Bpage_source
Cbrowser
Dget_screenshot_as_file
Attempts:
3 left
💡 Hint
Common Mistakes
Using get_screenshot_as_file instead of save_screenshot.
Using incorrect log type strings.