I am one object at " abc/td_Amount Due" which gives 6 web elements represented by one object repository and i want text of all the 6 web elements. I am trying to use LIST here but class cast error is showing. I am sharing code, please have a look
public class webele
{
@Keyword
public String value()
{
List <WebElement> elementList = (List<WebElement>) WebUI.getText(findTestObject('Page_ Review Allocations/td_Amount Due'))
// Fetching the size of the list
int listSize = elementList.size()
for (int i=0; i<listSize; i++)
{
println elementList[i]
}
}
}
error:Test Cases/abc- 111 FAILED because (of) org.codehaus.groovy.runtime.typehandling.GroovyCastException: Cannot cast object ‘1.50’ with class ‘java.lang.String’ to class ‘java.util.List’
here 1.50 is my text value of the webelement and there are 5 others text values which is also represented by same object. So all should be there in the list but not coming. Please provide any suggestion