Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Extended variable assignment doesn't work with @ or & syntax #5405

Closed
@ericli-splunk

Description

@ericli-splunk

Version info

  • Robot Framework 7.2.2 (Python 3.11.11 on darwin)
  • OS: macOS 15.3.2

Steps to reproduce

  1. Run the following robot test, (e.g. robot a.robot)
    *** Test Cases ***
    Test
        ${a}=    Create List    v1    v2
        @{b}=    Create List    w1    w2
        &{c}=    Create Dictionary
        ${c.d}=    Set Variable    x
        ${c.e}=    Create List    y1    y2
        @{c.f}=    Create List    z1    z2
        Log    a=${{repr($a)}}    WARN
        Log    b=${{repr($b)}}    WARN
        Log    c=${{repr($c)}}    WARN
    
  2. See the following warning messages
    a=['v1', 'v2']
    b=['w1', 'w2']
    c={'d': 'x', 'e': ['y1', 'y2']}
    

Expected behavior: see

a=['v1', 'v2']
b=['w1', 'w2']
c={'d': 'x', 'e': ['y1', 'y2'], 'f': ['z1', 'z2']}

Explanation: According to Create List's documentation, its result can be assigned to either ${scalar} or @{list} variables. It also works well when assigning to ${c.e} (c is a dictionary). However, it does not work when assigning to @{c.f}. Also, there are no error messages about the failed assignment.

Metadata

Metadata

Assignees

Type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions