Skip to main content

Use Page Objects in Protractor for Spaghetti free Code

Firstly, what are Page Objects? Here is a definition from the Selenium team:
Page Object is a Design Pattern which has become popular in test automation for enhancing test maintenance and reducing code duplication. A page object is an object-oriented class that serves as an interface to a page of your AUT. The tests then use the methods of this page object class whenever they need to interact with that page of the UI. The benefit is that if the UI changes for the page, the tests themselves don’t need to change, only the code within the page object needs to change. Subsequently all changes to support that new UI are located in one place.

Using Page objects in test cases has been very useful. It will feel hard and time consuming initially but, once you have all page objects up and running. Its going be a smooth ride . Till now writing test cases for an Angular Apps has been smooth ride. Thanks to some good articles online to get me going.

I have found some very helpful resources, which talks about using Page objects in Protractor for end-to-end testing which, I would like to share with other peps... Enjoy..


Comments

Popular posts from this blog

Must-see presentation for end to end testing using protractor for angularJS apps

In Wellington AngularJS meetup , I gave a talk on using protractor for end to end testing of angularJS applications . Here I presented and demonstrated some best practices with a live demo on how to get started with using protractor for e2e testing. My presentation and demonstration application are both available online. Links are as below: My presentation My demo angular app for demonstrating some best practices like page objects, reporting, login etc.

Essential Linux Monitoring Tools in 2024

Essential Linux Monitoring Tools in 2024 Essential Linux Monitoring Tools in 2024 In the ever-evolving landscape of IT infrastructure, the role of a system administrator is critical to maintaining the health, performance, and security of Linux servers. With the multitude of monitoring tools available, it's essential to select the right ones to meet your specific needs. This blog explores the essential Linux monitoring tools every sysadmin should consider, categorized into command line, network, system, log, and infrastructure monitoring tools. Command Line Monitoring Tools 1. top/htop top and htop are quintessential for real-time monitoring of system processes. htop offers a more user-friendly and interactive interface compared to top . Real-time process monitoring. CPU, memory, and swap usage. Process management capabilities (kill, renice). 2. iotop iotop is a handy tool for monito...

Are Code Challenges Useful?

Are Code Challenges Useful? Are Code Challenges Useful to Learn? In the rapidly evolving world of technology, staying relevant and sharpening your programming skills are crucial. One method that has gained popularity among both beginners and seasoned developers is the use of code challenges. But are these challenges genuinely useful for learning, or are they just a trendy distraction? Let's delve into the benefits and potential drawbacks of code challenges to understand their role in the learning process. The Benefits of Code Challenges 1. Reinforcement of Concepts Code challenges are excellent for reinforcing theoretical knowledge. They require you to apply concepts in practical scenarios, helping to cement your understanding. When you solve a problem using loops, data structures, or algorithms, the repetition and application in different contexts make these concepts more intuitive and memorable. 2. Problem-Solving...