1

ループ内に挿入されたコレクションを作成する必要があります。ですから、グローバルコレクションが必要です。そのコレクション変数は、ForループでRobot Frameworkを使用する必要があります。空のリストを作成し、ロボットフレームワークを使用して反復でデータをプッシュします

が親切コード

*** Settings *** 
Library Selenium2Library 
Library Collections 

*** Keywords *** 
Parent Routine 
    ${ScoreList} ??? 
    : For ${i}  IN RANGE 1 5 
    \ Append To List ${ScoreList} ${i} 
    #\ Some other manipulation 


*** Test Cases *** 
Sample Test Case 
    [Documentation] Simple test for Collection 
    Parent Routine 

を見て、私は親切にどのようにこれを達成するために私を助けるhttp://robotframework.org/robotframework/latest/libraries/Collections.html

を言及しました。あなたが宣言を逃したあなたのコードで

答えて

2

は、他の言葉であなたは以下のコード

@{ScoreList}= Create List 

完全なコードを使用する必要があるリストを宣言するには、キーワードにCreate List

を使用してリストを作成する必要がありますis

*** Settings *** 
Library Selenium2Library 
Library Collections 

*** Keywords *** 
Parent Routine 
    @{ScoreList}= Create List 
    : For ${i}  IN RANGE 1 5 
    \ Append To List ${ScoreList} ${i} 
    #\ Some other manipulation 
    :FOR ${item} IN @{ScoreList} 
    \ log to console ${item} 


*** Test Cases *** 
Sample Test Case 
    [Documentation] Simple test for Collection 
    Parent Routine 
関連する問題