Home > other >  issue with loging a list and list element in robot frame work
issue with loging a list and list element in robot frame work

Time:10-30

i want to log a list in robot frame work

i tried LOG @{listname} but it throws an error

to acccess the list element i use LOG @{listname}[0] it also throws an error

LOG @{listname} -- print list to log LOG @{listname}[0] -- print the first element to log

CodePudding user response:

Reference: https://robotframework.org/robotframework/latest/libraries/Collections.html#Log List There is Log List to log all the values in List. Please see the below example

*** Settings ***
Library    Collections

*** Variables ***
@{NUMBERS}       ${1}    ${2}    ${5}
@{NAMES}         one     two     five
*** Test Cases ***
Logs Lists
    Log List    ${NUMBERS}

Log Scalar Variable
    Log    ${NUMBERS}[0]
    
  • Related