🎙 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 9 of 10

Why are URLs and browser names passed with -D properties instead of hard-coded?

Why are URLs and browser names passed with -D properties instead of hard-coded?

  1. A.Hard-coded values do not compile
  2. B.So the same tests can run against different environments and browsers without code changes
  3. C.Properties make tests faster
  4. D.Maven forbids strings in tests
Answer & explanation

Correct answer: So the same tests can run against different environments and browsers without code changes

For example: -Dbrowser=firefox -Dheadless=true.

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 →