【发布时间】:2021-02-21 06:17:00
【问题描述】:
我是 Robot Framework 的新手,现在在我的机器人脚本中使用 DataDriver 库时卡住了。
我的问题: 有一条消息:“未找到变量 '${username}'。”当我运行机器人脚本时,测试失败了。
这是我的机器人脚本:
*** Settings ***
Library DataDriver file=resources/user_password.csv encoding=utf_8 dialect=unix
Test Template Test Credential
*** Test Cases ***
Doing Test Credentials for ${username} and ${password}
*** Keywords ***
Test Credential
[Arguments] ${username} ${password}
Log ${username}
Log ${password}
这是我的 CSV 文件:
*** Test Cases ***, ${username}, ${password}, [Tags], [Documentation]
Valid user, user@mail.com, pass123, Positive, This is valid user credential
Invalid user, invalid@mail.com, pass123, Negative, This user is invalid
Invalid password, user@mail.com, pass, Negative, This password is invalid
Blank user, ${EMPTY}, pass123, Negative, Blank user
Blank password, user@mail.com, ${EMPTY}, Negative, Blank password
Blank user and password, ${EMPTY}, ${EMPTY}, Negative, Blank both user and password
任何帮助将不胜感激。谢谢。
威利
【问题讨论】:
标签: robotframework