Answered

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.

0
6 comments
Avatar
Joseph Hamdan

Hi Stephen,

1. On which iteration are you seeing this error?

2. How many total rows do you have in the list? 

3. Can you please copy/paste the logs from your local player? Right click icon in the tray > Diagnose and Feedback > Logs.

Regards,
Subject7 Team

0
Comment actions Permalink
Avatar
Joseph Hamdan

Hi Stephen,

Would you please respond directly to the post? The notification you receive via email is a "NO-REPLY" so responses cannot be sent to it.

Regards,
Subject7 Team

0
Comment actions Permalink
Avatar
Abayomi Akinpelumi

Hi Joseph, please see my responses below..

 

  1. Turing 10.2.11.3784
  2. 68
  3. 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

 

0
Comment actions Permalink
Avatar
Abayomi Akinpelumi

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:

0
Comment actions Permalink
Avatar
Abayomi Akinpelumi

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

 

 

0
Comment actions Permalink
Avatar
Zach Schwantes

Hello, this is probably not the best solution, but should be a work around until the problem can be figured out. You should have your variable configured like the following.

0
Comment actions Permalink

Please sign in to leave a comment.