如何访问 Robot Framework 中的列表变量值

How do I access List Variables values in Robot Framework

如何从 List 变量访问特定值? 相反,它打印整个列表

*** Settings ***
Documentation    This Suite will have login test cases
#Library     SeleniumLibrary
Library     Selenium2Library
Resource   ../Resources/CommonFuntionality.robot
Variables   ../WebElements/Locators.py

*** Variables ***
@{userList}  standard_user  locked_out_user  problem_user  performance_glitch_user
${password}  secret_sauce
*** Keywords ***
Login With Valid User
    log to console  @{userList} [1]  **// This print entire list [standard_user  locked_out_user  problem_user  performance_glitch_user] instead I want locked_out_user to get print**
    input text  ${xUsername}  @{userList} [1]
    input text  ${xPassword}  ${password}
    click element  ${xLoginBtn}


希望能帮到你

*** Variables ***
@{LIST}=          one    two    three

*** Test Cases ***

Print Value
    Log To Console      ${LIST[0]}

输出:

Print Value                                                           one
Print Value                                                           | PASS |