unable to retrieve value from generated list in loop
I am getting an error message when trying to retrieve value from generated list in a loop...
Execution Exception: Cannot evaluate loop end variable: @links_list2.rowsCount-1
Execution failed at step 31. Message Execution Exception: Cannot evaluate loop end variable: @links_list2.rowsCount-1
.. please see screenshots below.
Hi Joseph, please see my responses below..
- Turing 10.2.11.3784
- 68
- Please see error logs below...
[INFO] Step index=24 PASS 23981(ms) [Call function BT1_CPS_Login_Internal ] message='Executed #5 steps'
[WARN] java.lang.RuntimeException: Cannot evaluate loop end variable: @links_list2.rowsCount-1
[INFO] Step index=30 ERROR 20(ms) [Loop through commands, starting from 1 to @links_list2.rowsCount-1 and incrementing by 1, and store the loop number in rows] message='Execution Exception: Cannot evaluate loop end variable: @links_list2.rowsCount-1'
[INFO] Step index=30 FAIL 20(ms) [Loop through commands, starting from 1 to @links_list2.rowsCount-1 and incrementing by 1, and store the loop number in rows] message='Execution failed at step 31. Message Execution Exception: Cannot evaluate loop end variable: @links_list2.rowsCount-1'
[DEBUG] Test case execution has been completed
[INFO] Test execution id=0 finished. Status='FAIL', Message='Execution failed at step 31. Message Execution Exception: Cannot evaluate loop end variable: @links_list2.rowsCount-1'
[DEBUG] Execution has been completed
[DEBUG] Execution service shutdown complete
Hi Zach, I was following the instructions provided on https://subject7.atlassian.net/wiki/spaces/SD/pages/879493553/SET+LIST+Command for Scenario 2
(Scenario 2) Suppose we want to loop through all values from the table into the Email address text box on Reference app.
Procedure:
A- Create an automated test case and use Set_List command to generate the list from the data set.
B- Create steps that navigate to Reference app and click on the Login link.
C- Add a Loop step with the following parameters:
Start 0
End @list_variable.rowsCount-1
Step 1
NOTE: list_variable is the variable defined in step A.
NOTE: “rowsCount-1” will take existing data from rows
D- Add another loop step with the following parameters:
Start 0
End @list_variable.columnsCount-1
Step 1
NOTE: list_variable is the variable defined in step A
NOTE: “columnsCount-1” will take existing data from columns
E- Add a Fill step that fills the formula below into the Email address text box. For easier readability, add a space after this line or a slash or any character your like.
@list_variable[@rows_variable][@columns_variable]
F- Add two Loop_End steps to finish the loop. Your steps will look like this:
Update – As suggested, I made the @links_list2.rowsCount variable to a new variable called ‘RowCount’; entered that in step 32 and still got the same error…
Execution Exception: Cannot evaluate loop end variable: @RowCount
Execution failed at step 32. Message Execution Exception: Cannot evaluate loop end variable: @RowCount
…when I use any other defined variable or static value it works.
The purpose is to retrieve values from the list I created with the list’s row count
Please sign in to leave a comment.