Bird
0
0

Which locator strategy is NOT supported directly by the @FindBy annotation?

easy📝 Conceptual Q2 of 15
Selenium Java - Page Object Model
Which locator strategy is NOT supported directly by the @FindBy annotation?
Aid
Bregex
Ccss
Dxpath
Step-by-Step Solution
Solution:
  1. Step 1: Review supported locator strategies

    @FindBy supports common locators like id, xpath, css, name, className, tagName, linkText, and partialLinkText.
  2. Step 2: Identify unsupported locator

    Regex is not a locator strategy supported by @FindBy directly; it requires custom code or filtering after locating elements.
  3. Final Answer:

    regex -> Option B
  4. Quick Check:

    @FindBy supports id, xpath, css but not regex [OK]
Quick Trick: Regex is not a direct locator in @FindBy [OK]
Common Mistakes:
MISTAKES
  • Assuming regex works like xpath or css
  • Confusing css with cssSelector
  • Thinking @FindBy supports all Java regex patterns

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Selenium Java Quizzes