Git Product home page Git Product logo

Comments (3)

boakley avatar boakley commented on August 19, 2024 1

The problem is that you have not provided an implementation for the method _is_current_page. The default implementation assumes there is a class attribute named PAGE_TITLE. You haven't defined that variable, and there's a bug in the default implementation of _is_current_page that throws this error when it can't find the expected page title.

The simple solution is to add a definition for PAGE_TITLE to your class definition:

class LoginPage(PageObject):
    PAGE_TITLE = "The Internet"
    ...

This is both a bug in the definition of the PageObject class, but also in my documentation. Thanks for reporting the issue.

from robotframework-pageobjectlibrary.

GLMeece avatar GLMeece commented on August 19, 2024

@automationTestStudent - have you tried specifying the namespace for each of the methods/keywords you're trying to use? In other words:

Valid Login
    [Setup]     Go to page      LoginPage
    Enter Username              tomsmith
    Enter password              SuperSecretPassword!
    LoginPage.new_keyword
    Click the login button
    The current page should be  SecureAreaPage
    SecureAreaPage.new_keyword
    sleep 5

My advice is to use a different keyword name for each of these page objects. If you need a method that is universal, see Bryan's article on Mixins.

from robotframework-pageobjectlibrary.

boakley avatar boakley commented on August 19, 2024

@GLMeece it's perfectly fine (and, arguably, very common) to have the same keyword in multiple page objects. While you are correct that using a fully qualified keyword name can work, the page object library was designed so that you shouldn't need to do that.

from robotframework-pageobjectlibrary.

Related Issues (19)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.