logo-tera
logo-tera

Some best practices for Software Testing: Page Object Model and Data Driven design patterns

  • QA

15 March 2018

Share
facebookfacebookfacebook
banner

There has been a lot of talk on automated QA testing and how this strategy can lead companies to save time and resources. Yet there is still a big misunderstanding on how to incorporate an automated approach to perform tests. It requires knowledge of not only software QA testing but also application development skills. Even though, this mix of skill sets is only the beginning.

What do you need to know about QA Automation?

In my opinion, it requires a good QA core and a deep understanding of best practices both in application development and test development. All those aspects are learned through experience; reuse, recycling, and maintenance. Remember that automation tries to reduce manual efforts in regression testing, and any sort of repetitive tasks, should be focused on testing new features, so if the QA Team creates an effective automated testing framework, new tests can be developed and added quickly in parallel to manual tests.

All programming background knowledge is important, and you must also know there exist specific strategies to implement automated tests, no matter if it’s for mobile testing, web or another kind of test.

Two of these strategies I consider must be used without exception are Page Object Model and Data-Driven design patterns.

In simple words, a Page Object is supported by an object-oriented approach or a class that represents all the functionalities included in a single page of the application to be tested. So,  every single view is related to a specific Page Object class. Abstraction and encapsulation are Object Oriented principles applied to conceive this useful best practice.

This kind of design avoids duplicated functionalities, providing a clear interface to interact with each piece of the application. Page Objects also prevent that changes in UI affect the test structure because only the specific page object needs to be changed and tests are not affected by those changes.

There are more details to add in Page Objects so it’s up to you to learn more about this topic. Now, what would you think if you were asked to create several testing scenarios using each page object, e.g, you need to create all possible combinations to test a Login page? Well, perhaps the example doesn’t look too complicated but you can create as many objects as you need to represent those scenarios and at the end, you’ll notice you are replicating the code over and over again. And every time a new scenario will be required, you’ll have to change your code or at least your coded tests. Don’t worry, best practices can be combined. It is possible to provide data from external data sources: CSV, text. XML. databases. The idea is to separate your Page Objects, your tests, and data.

This approach is known as Data-Driven Tests or Data-Oriented Tests. This strategy allows you to define as many several testing scenarios that you need without affecting your Page Objects or your coded tests. Tests can be specified in external files and if your testing framework has evolved enough to process these files, you’ll only have to provide data and to specify conditions to be interpreted by the testing framework, invoking the required Page Objects to perform the tests.

Creating a very well designed framework involves all the knowledge and expertise you have but it will give you a lot of benefits and ease to create and adapt your test quickly. Best practices exist for all kinds of activity, including software testing quality assurance areas, just don’t forget them and take advantage of them.

  • Software Testing Quality Assurance
  • Mobile Testing

Related Articles

  • QA
  • Testing

Manual and Automation Testing, What’s The Difference?

29 July 2022
cards-img-web
  • QA
  • Software Development
  • UI/UX Design
  • Hackathon
  • Teamwork
  • Ui Design
  • Ux Design

A Hackathon Keeps Your Team Working in Sync

01 June 2021
cards-img-web
  • Mobile App Development
  • QA
  • Software Development
  • Startups
  • UI/UX Design

1871 Partners with Teravision to support Technology Startups

15 May 2019
cards-img-web
Let's
build
together

SET UP A DISCOVERY CALL WITH US TODAY AND accelerate your product development process by leveraging our 20+ years of technical experience and our industry-leading capability for quick deployment of teams with the right talents for the job.