Search code examples
robotframework

How to properly use 'Copy List' in Robot Framework


I have searched the documentation and this question but still no luck on my side. I just want to use the 'Copy List' keyword.

 *** Settings ***
    Documentation       Example of working with Lists
    Variables           variables.py
    Library             SeleniumLibrary
    Library             Collections

*** Variables ***

*** Test Cases ***
[TC01] Copy List Example
   @{list1} =  create list     item1    item2    item3    item4
   @{clist1} = copy list       ${list1}

*** Keywords ***

I get an error:

No keyword with name '@{clist1} = copy list' found.

Solution

  • Your file format is wrong. Read this section "Space separated format" and figure it out.

    Correct space separated format:

    @{clist1}=    Copy List    ${list1}