man-group / man-group/page-objects

Return PageElement object from Function

Open
#6 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
126
Forks
48
PR merge metrics
No merged PRs in 30d

Description

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

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading the PageElement and PageObject behavior used by AdminPage.partial_link. Reproduce the AttributeError when calling click() on the returned object, then verify that the function returns an object on which click() works as expected.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
testing-qa, web-dev
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.