0
0
Selenium Pythontesting~10 mins

Select class for dropdowns in Selenium Python - Interactive Code Practice

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

Complete the code to import the Select class from selenium.webdriver.support.ui.

Selenium Python
from selenium.webdriver.support.ui import [1]
Drag options to blanks, or click blank then click option'
AWebDriverSelect
Bselect
CDropdown
DSelect
Attempts:
3 left
💡 Hint
Common Mistakes
Using lowercase 'select' instead of 'Select'.
Trying to import from wrong module.
2fill in blank
medium

Complete the code to create a Select object for a dropdown element stored in variable dropdown_element.

Selenium Python
select = [1](dropdown_element)
Drag options to blanks, or click blank then click option'
ASelect
BDropdown
CWebDriverSelect
DSelectElement
Attempts:
3 left
💡 Hint
Common Mistakes
Using a wrong class name like 'Dropdown'.
Forgetting to pass the WebElement.
3fill in blank
hard

Fix the error in the code to select an option by visible text 'Option 1'.

Selenium Python
select.[1]('Option 1')
Drag options to blanks, or click blank then click option'
AselectByVisibleText
Bselect_by_visible_text
Cselect_by_value
Dselect_by_text
Attempts:
3 left
💡 Hint
Common Mistakes
Using camelCase method names like 'selectByVisibleText'.
Using incorrect method names like 'select_by_text'.
4fill in blank
hard

Fill both blanks to select an option by index 2 and then deselect all options.

Selenium Python
select.[1](2)
select.[2]()
Drag options to blanks, or click blank then click option'
Aselect_by_index
Bdeselect_all
Ddeselect_all_options
Attempts:
3 left
💡 Hint
Common Mistakes
Using wrong method names like 'deselect_all_options'.
Using camelCase instead of snake_case.
5fill in blank
hard

Fill all three blanks to create a Select object, select by value 'val1', and print the first selected option's text.

Selenium Python
select = [1](dropdown)
select.[2]('val1')
print(select.[3].text)
Drag options to blanks, or click blank then click option'
ASelect
Bselect_by_value
Cfirst_selected_option
Dselect_by_index
Attempts:
3 left
💡 Hint
Common Mistakes
Using wrong method names or attributes.
Trying to print the selected option incorrectly.