Answered

Reference to a list row and column by a index of a calculation type is not working

If we want get values from a list we need to pass the indexes for rows or columns for desired data. If the index is number or a variable which a number is assigned to it, it will work and get the data from the list. However, if in some cases the index number need to come from a calculation it will not work.

For example, we have variable index = 2, now we want to get to a row 1 by using @test_list[@index-1][2], this will not work , the command doesn't interpret [@index-1]  as [1].

This creates issues for us when we try to loop through tables between the the list we have and data in application (UI or Web Services response) because most of the time our indexes in applications starts with 1 where in the list we have it starting from 0 so we have to use our index-1 to refer to data in the list but it doesn't work.

Below screenshot of an example, reference to the table by numbers works but by calculation is not working

 

0
2 comments
Avatar
Jonathan Hotz

Hi Hasib,

we can suggest to use another Set_Var command for index calculation at this moment to solve your problem.

In Set_Var you can select option Expression instead of static and calculate your index like @index-1

0
Comment actions Permalink
Avatar
Hasib Rostaiee

Hi Alexei, yes, i'm using that workaround but I wanted to bring it up if can be considered to be fixed in the next release. Also, we have the same issue using xpath in "GET_REST_VALUE" command, if the xpath for finding elements has an index of calculated value, it doesn't work.

Thanks,

0
Comment actions Permalink

Please sign in to leave a comment.