Basic sum of the list program,
sum=0
for i in [1, 2, 3, 4]:
sum=sum+i
print(sum)
Robot framework sum of the list, I’m trying:
*** Settings ***
Library SeleniumLibrary
Library DatabaseLibrary
Library Collections
*** Test Cases ***
Additon of lists
@{list}= Create List 1 2 3 4
${index}= Set Variable 0
FOR ${i} IN ${list}
${index}= Evaluate ${index}+${i}
Log ${index}
END
Error:
Additon of lists | FAIL |
Evaluating expression ‘0+[‘1’, ‘2’, ‘3’, ‘4’]’ failed: TypeError: unsupported operand type(s) for +: ‘int’ and ‘list’
List | FAIL |
1 test, 0 passed, 1 failed