I am trying to get the list of project names from a table. Where by using locateAll() method I am able to get the list of elements but when I try to convert them into text value the result is null.
* def ProjectNames = locateAll("//div[@id='Projects']/@somePath")
* print ProjectNames
Above code displays
[DriverElement@aef32g2
DriverElement@ahf38g2
DriverElement@ayf12gj
DriverElement@ae032f2]
But expectation is to get result as below:
[Project1
Project2
Project3
Project4]
For which I tried - * print ProjectNames.text.trim()
but this displays nothing and step is passed. Instead when I execute it for particular index value it displays the text for that * print ProjectNames[0].text.trim()
. How can I do it for complete list received?
Thanks in advance!