0

When designing an automation framework, should i start by populating page object models with all of the elements in my application or only the elements that are being used within exsisting test scripts?

For example, smoke/regression tests I have tried the approach of automating smoke/regression tests and found that duplicate unorganised code is a problem.

undetected Selenium
  • 183,867
  • 41
  • 278
  • 352
Gs10
  • 11
  • 1
  • Have you ever tried screenplay pattern? – ggeorge Jun 27 '23 at 20:45
  • No i have actually never heard of this. The plan is to use specflow which seems to be a similar tool? My question was more around the design of the page object model and should i capture all of the elements in a particular section of the product or just the elements that will be used in current test scripts. – Gs10 Jun 27 '23 at 21:09
  • Populating page object models with only the elements used in existing tests allows you to focus on automating the core functionality and verifying critical scenarios. This approach helps in avoiding duplication of code and ensures that you are automating the most important parts of your application first. – Murat Ishenbaev Jun 27 '23 at 21:42
  • This question is far too open-ended to be answerable. You will get as many answers as there are people, which does not fit the format of this community. Can you [edit] your question to focus on a single problem? It should include a [repro] as well. – Greg Burghardt Jul 12 '23 at 20:32

1 Answers1

1

Ofcoarse the should only contain the elements that are being used within exsisting test scripts.

There is no point in defining any element within the pageobjects which aren't used. Doing so will result into dead code / unreachable code which can never be executed because there exists no control flow path to the pageobjects from the rest of the program.


References

A few references:

undetected Selenium
  • 183,867
  • 41
  • 278
  • 352