lecture 8 of 150 completed

Keeping selectors in one place

When the same selectors appear in ten files, one UI change breaks all of them. Put them in one object.

What you'll learn

  • Why repeated selectors make one UI change expensive
  • How to keep locators in one place
  • Why page objects should not assert

Custom commands fixed repeated actions, like login. There is a second kind of repetition, and it hurts just as much.

Look at these three lines. They appear in eight different test files:

members only

Keep reading with the full course

The Foundations track and the first 5 lectures of each framework are free. This lecture is part of the paid course, which unlocks every lecture, all three frameworks, and downloads.

See the options →