GetAttribute value of multiple identical elements

Hello all,

I want to get specific Attribute value of multiple identical elements. For example I have an Object named where the following object property is assign <spot != “”>. When I run the following statement on my TC
<numberOfElements = WebUiCommonHelper.findWebElements(findTestObject(‘DataSpotID’), 5).size()
println(numberOfElements)

It returns 6 elements, which is correct on my end

Then after If I run the following statement
<attribute = WebUI.getAttribute(findTestObject(‘DataSpotID’), ‘spot’)
println(attribute)

It returns a value of a number “11223344” where is the first of the 6 elements

How I can get all the elements specific property values?

Thanks

you can go over the list from findWebElements

List list=WebUiCommonHelper.findWebElements(findTestObject(‘DataSpotID’), 5)
for(int i=0; i<list.size();i++){
WebElement el=list.get(i)
println el.getAttribute(‘spot’)
}

1 Like