I have list of web element there are totally 3 values in list of web element I want to do addition of that values in BigDecimal I have return following code
Public BigDecimal calculatebigdecimal{
List<WebElement> elementValues = driver.findElements(By.xpath(“xpath to element”));
String values;
BigDecimal elementValueTotal= null;
BigDecimal sum = null;
for(int i =0; i<elementValues.size();i++)
{
values = elementValues.get(i).getText();
elementTotal = new BigDecimal(values);
elementTota.plus();
}
return elementTotal;