Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8166233
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T19:47:20+00:00 2026-06-06T19:47:20+00:00

I am modeling my web app interaction using the Page Object pattern. Most pages

  • 0

I am modeling my web app interaction using the Page Object pattern.
Most pages in the app have some standard options like “log in”, “log out”, “home”, etc.
Additionally, they all have a protected WebDriver reference.

So I created a super-super class that all pages will inherit – GrandpaClass. This will only contain a protected WebDriver reference and a constructor to initialize the driver.

I then created a super class that most pages will inherit – PapaClass. It inherits GrandpaClass and adds the standard menu functionality I listed above (log-in, etc.)

The problem arises when the same menu action can result in different pages displayed. For example, when you log out you can either go to the login page, or back to an error page. But since the log-in functionality is in the PapaClass, this class has to return different pages, that inherit from him. This makes the superclass dependent on its subclasses.

I was thinking of using something like Strategy to factor out the common menu functionality. So the PapaClass, instead of maintaining the functionality, will only maintain a reference to the Menu object.

Is this a good idea, or is there a more elegant (or simpler) way to solve this?

Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T19:47:22+00:00Added an answer on June 6, 2026 at 7:47 pm

    I think your Menu object is a good idea, but you don’t need the PapaClass. You can just have all your pages inherit from the GrandpaClass and use Composition where there are common elements. With inheritance you are saying ‘is a page with a menu’ which suggests the page should just have a menu.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm modeling my app in Core Data. I have an object called 'stats' that
I have a modeling question related to profiles. Firstly, I have looked into using
Whilst building a Windows Phone 7 app. using the MVVM pattern we've struggled to
Let's say I'm modeling a website where a web page would be represented by
I'm modeling a database relationship in django, and I'd like to have other opinions.
I have some ideas for web apps. Sadly, I have very little knowledge of
We have a modeling tool which uses OCC, and a 3d editor using OSG.
Is there a pattern or a gem (Ruby on rails) for modeling the wiki-like
I have an MVC2 n-tier application (DAL, Domain, Service, MVC web) using a DDD
I am modeling a 'friends' relationship between the user of my micro-blog app. It

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.