2016-11-02 56 views
2

我試圖將2個標量和2個列表變量傳遞給用戶關鍵字,但我得到了「無效參數說明:可變參數後的位置參數」。是不是可以將多個列表變量傳遞給用戶關鍵字?無效的參數說明:可變參數後的位置參數

我想什麼:

*** Test Cases *** 
Sample Case 
    Personal Details Page Fill Form ${firstName} ${surname} @{dateofbirth} @{nextsalarydate} 

    *** Keywords *** 
Personal Details Page Fill Form 
    [Arguments] ${firstName} ${surname} @{dateofbirth} @{nextsalarydate} 
    Input Text id = firstName ${firstName} 
    Input Text id = lastName ${surname} 
    Personal Details Page Select Date of Birth ${dateofbirth[0]} ${dateofbirth[1]} ${dateofbirth[2]} 
    Personal Details Page Select Next Salary Date ${nextsalarydate[0]} ${nextsalarydate[1]} ${nextsalarydate[2]} 
+0

請更新與您要執行的代碼片段的問題。 –

回答

4

當您通過多個列表變量放到用戶的關鍵字,你應該使用「$」列表,而不是「@」。試試如下:

*** Test Cases *** 
Sample Case 
    Personal Details Page Fill Form ${firstName} ${surname} ${dateofbirth} ${nextsalarydate} 

*** Keywords *** 
Personal Details Page Fill Form 
    [Arguments] ${firstName} ${surname} ${dateofbirth} ${nextsalarydate} 
    Input Text id = firstName ${firstName} 
    Input Text id = lastName ${surname} 
    Personal Details Page Select Date of Birth ${dateofbirth[0]} ${dateofbirth[1]} ${dateofbirth[2]} 
    Personal Details Page Select Next Salary Date ${nextsalarydate[0]} ${nextsalarydate[1]} ${nextsalarydate[2]}