How to get a series of numbers from objects of a WEB APP and add them , and verify if the total value corresponds with the adding of those numbers?

Tuesday, September 25, 2018 9:59:43 AM

I'm facing some difficulties in one case I have in my web app I'm currently working with, where there are multiple rows containing number values changing dynamically time after time, and there is TOTAL which is supposed to calculate all these numbers I mentioned above.
I want to create a script that will get the values of these numbers every time I run it, add between them and compare to the Total row.

Any help on this?

1 Replies
Saturday, September 29, 2018 2:35:14 PM
Avatar
re: jurial on Tuesday, September 25, 2018 9:59:43 AM

Hi Jurial,

To get the values of each row, you can LEARN the table object in Rapise and then use something like:

var rows = SeS("object").DoDOMQueryXPath('//tr');
for (var i = 0; i < rows.length; i++)
{
  var cell = rows[i].DoDOMQueryXPath('td[x]')[0];
  var val = Math.parseInt(cell.GetNodeText());
}

to get the value of each cell as a  number. Then use the same GetNodeText() on the total row, and compare using standard JavaScript functions.

You could also do it in RVL in a similar way.

Regards

Jim

Statistics
  • Started: Tuesday, September 25, 2018 9:59:43 AM
  • Last Reply: Saturday, September 29, 2018 2:35:14 PM
  • Replies: 1
  • Views: 87