The correct syntax uses @FindBy with attribute name and value separated by =, e.g., id = "value".
Step 2: Check each option
@FindBy(id = "username") private WebElement usernameField; uses correct syntax. The other options have syntax errors like missing attribute name, colon instead of equals, or double equals.
Final Answer:
@FindBy(id = "username") private WebElement usernameField; -> Option B
Quick Check:
@FindBy syntax = attribute = "value" [OK]
Quick Trick:Use equals sign in @FindBy attribute assignment [OK]
Common Mistakes:
Omitting attribute name in @FindBy
Using colon instead of equals
Using double equals in annotation
Master "Page Object Model" in Selenium Java
9 interactive learning modes - each teaches the same concept differently