我已经安装了 python 版本 3.5.1 和机器人框架。 我写了下面的测试(我试过其他人也有同样的结果):
*** Settings ***
Library Selenium2Library
*** Variables ***
${MESSAGE} Start of test
${BROWSER} ff
${keywork} dell
*** Test Cases ***
Search Emag For Computer
[Documentation] Example test
Log ${MESSAGE}
Do this www.emag.ro dell "rezultate pentru"
*** Keywords ***
Do this
[Arguments] ${URL} ${keyword} ${result}
Open Browser ${BROWSER}
Input Text id=emg-input-autosuggest ${keyword}
Wait 20
Close Browser
当使用 robot testName.rst 从控制台运行测试时 我总是得到: [错误] 解析“testName.rst”失败:文件没有测试用例表。 但是我的测试用例表显然在那里。 请帮忙
最佳答案
您正在使用 .rst
后缀,这意味着 reStructuredText格式,但您的文件是以纯文本格式编写的。由于后缀,机器人试图根据 reStructuredText 语法对其进行解析,而您没有该格式的任何测试表。
您可以通过将文件重命名为 testName.txt
或 testName.robot
来解决此问题。
关于python - 机器人框架测试不运行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35016227/