← Quiz: Page Object Model: all 10 questions
Quiz: Page Object Model · Question 6 of 10
In the Page Object Model, why are locators kept private inside page classes?
In the Page Object Model, why are locators kept private inside page classes?
- A.Java requires all fields to be private
- B.So tests use page actions, and a changed locator is fixed in one place only
- C.Private locators load faster
- D.To hide them from the browser
Answer & explanation
Correct answer: So tests use page actions, and a changed locator is fixed in one place only
Tests stay unchanged when the HTML changes.
Can you get the rest right without peeking?
Take the timed Quiz: Page Object Model quiz free. Pass it to earn XP and count towards your certificate.
Start the quiz →