我试图将2个标量和2个列表变量传递给用户关键字,但我得到了"无效的参数规范:varargs之后的位置参数".是不是可以将多个列表变量传递给用户关键字?
我想要的是:
*** 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]}
Run Code Online (Sandbox Code Playgroud)
当您将多个列表变量传递给用户关键字时,您应该使用'$'作为列表而不是'@'.请尝试以下方式:
*** 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]}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
3038 次 |
| 最近记录: |