Skip to content

← All questions

A header widget appears on six pages — one page object per page, or something else?

Example threads. These questions and answers were written by the SDODS team to document real problems and how to fix them. The people named are illustrative, not real users. Questions asked on this site are marked new.

Our header carries the cart badge, the account menu and a search box, and it is on six pages. Right now the cart badge locator is copy-pasted into six page objects, which was fine until the badge got a new test id and I had to fix it six times.

Splitting it out is obvious. What is not obvious is what the split looks like when the steps are decorators on classes that are registered per page.

3 answers

Know the answer?

Wrap commands and output in triple backticks and they will render as a code block.

Checking whether you’re signed in…

Have a different question? Ask it.

Related