How to create dynamic page Object in selenium using serenity

25 views
Skip to first unread message

Shariq Muhammad

unread,
Apr 17, 2018, 10:13:47 PM4/17/18
to Selenium Users
The problem is that I need to click on hyperlink  which is an ID of  Voucher that is newly generated

e.g:

lnk_EditPurchaseRequisition_1024


The last part of this link "1024" is dynamic every time new Voucher is generated the id is change.

So i am trying to create a page object in such a way like using Variable to create page object .

But I don't know how to create page object against a dynamic value.


@FindBy(id = "lnk_EditPurchaseRequisition")

private WebElementFacade hyperLinkForEdit;

anwesana kanungo

unread,
Apr 18, 2018, 1:51:40 AM4/18/18
to Selenium Users

Use xpath for locating the elements . Example : //*[contains(text(),'ABC')] 
Reply all
Reply to author
Forward
0 new messages