🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← 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?

  1. A.Java requires all fields to be private
  2. B.So tests use page actions, and a changed locator is fixed in one place only
  3. C.Private locators load faster
  4. 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 →