0

I am using webdriver.io

In one of my tests I need to get the text for all the elements with the same xpath that are in the page. How can I achieve this?

I know how to find the length of elements using client.elements() but not able to get the text. referred the link for this Counting elements with the same selector in webdriver.io

1 Answers1

1

You can do as below.

const textArray = browser.$$('.myElements').map(elem => elem.getText());
Raju
  • 2,299
  • 2
  • 16
  • 19