man-group/page-objects

Return PageElement object from Function

xiaoleATRI opened this issue · 1 comments

hi, @eeaston

I have an issue with using PageElement in function

  1. I defined function which use parameter 'p1' to locate link element
    `class AdminPage(PageObject):

    def partial_link(self, p1="Admin"):
    return PageElement(partial_link_text=p1)`

  2. When I call click() on the PageElement it shows as following

AttributeError: 'PageElement' object has no attribute 'click'

Seems like the element returned is not selenium element

class AdminPage(PageObject):
    admin_link = PageElement(partial_link_text='Admin')