0

I have 5 links with the same name and id and linktext. I am using serenity-js. how can I access the 4th link

page.ts has

static link = Target.the('click the 4th link').located(by.linktext('link'));

1 Answers1

0

Not sure if that can help anyone but Target finds all elements with specified selector, so what you can do in Java (not sure about javascript though) is you can map the result to:

List<WebElement> links = link.resolveAllFor(actor);

and then access by index links.get(x)