Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete the code to select an option by its value attribute.
Selenium Python
select.select_by_[1]('option1')
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using select_by_visible_text instead of select_by_value.
Trying to use select_by_index with a string value.
✗ Incorrect
The select_by_value method selects an option by its value attribute.
2fill in blank
mediumComplete the code to select an option by its visible text.
Selenium Python
select.select_by_[1]('Option 2')
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using select_by_value with visible text.
Using select_by_index with a string.
✗ Incorrect
The select_by_visible_text method selects an option by the text shown to the user.
3fill in blank
hardFix the error in selecting an option by index.
Selenium Python
select.select_by_[1](2)
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using select_by_value or select_by_visible_text with an integer index.
Trying to use a method named 'click'.
✗ Incorrect
The select_by_index method selects an option by its position number (starting at 0).
4fill in blank
hardFill both blanks to select by visible text and then by value.
Selenium Python
select.select_by_[1]('Option 3') select.select_by_[2]('val3')
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Mixing up the order of methods.
Using select_by_index instead of select_by_value.
✗ Incorrect
First select by visible text, then select by value attribute.
5fill in blank
hardFill all three blanks to select by index, then by value, then by visible text.
Selenium Python
select.select_by_[1](1) select.select_by_[2]('val2') select.select_by_[3]('Option 2')
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'click' instead of the correct method names.
Mixing the order of selection methods.
✗ Incorrect
The code selects options by index, then by value, then by visible text in order.