Bird
0
0

Which method of the Select class is used to select an option by its visible text?

easy📝 Conceptual Q2 of 15
Selenium Java - Handling Form Elements
Which method of the Select class is used to select an option by its visible text?
AselectByValue()
BselectOption()
CselectByIndex()
DselectByVisibleText()
Step-by-Step Solution
Solution:
  1. Step 1: Recall Select class methods

    The Select class provides methods like selectByValue(), selectByVisibleText(), and selectByIndex().
  2. Step 2: Match method to visible text selection

    To select an option by the text shown to the user, use selectByVisibleText().
  3. Final Answer:

    selectByVisibleText() -> Option D
  4. Quick Check:

    Select by visible text = selectByVisibleText() [OK]
Quick Trick: Use selectByVisibleText() to pick option by shown text [OK]
Common Mistakes:
  • Using selectByValue() instead of visible text
  • Trying to use a non-existent method like selectOption()
  • Confusing index with visible text selection

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Selenium Java Quizzes