Bird
0
0

Why might the Select class fail to select an option in a dropdown that looks like a dropdown but is built with <div> and <li> elements?

hard📝 Conceptual Q10 of 15
Selenium Java - Handling Form Elements
Why might the Select class fail to select an option in a dropdown that looks like a dropdown but is built with <div> and <li> elements?
AThe dropdown is disabled
BThe locator is incorrect
CSelect class only works with <code><select></code> elements, not custom dropdowns
DThe Select class requires JavaScript enabled
Step-by-Step Solution
Solution:
  1. Step 1: Understand Select class limitations

    The Select class only works with standard HTML <select> elements.
  2. Step 2: Recognize custom dropdowns

    Dropdowns built with <div> and <li> are custom and require different handling.
  3. Final Answer:

    Select class only works with <select> elements, not custom dropdowns -> Option C
  4. Quick Check:

    Select class = <select> only [OK]
Quick Trick: Select class cannot handle custom HTML dropdowns [OK]
Common Mistakes:
MISTAKES
  • Assuming Select works on all dropdown-like elements
  • Blaming locator or JavaScript settings
  • Not recognizing custom dropdown structure

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Selenium Java Quizzes