在RIDE中导入TestLink库,您需要按照以下步骤操作:
在RIDE中打开你的测试项目。
在左侧的“文件夹”窗格中,右键单击“Keywords”文件夹,并选择“添加新文件”。
在弹出窗口中输入一个名称,如“testlink_keywords.robot”,然后点击“确定”。
编辑新创建的关键字文件,在文件头部添加以下代码:
*** Settings ***
Library TestLinkKeywords
*** Variables ***
${TESTLINK_API_PYTHON_CLIENT_PATH} /path/to/your/TestLink-API-Python-client
*** Keywords ***
Connect to TestLink Server
[Arguments] ${server_url} ${dev_key}
... [Documentation] Connects to the TestLink server.
... [Return] A handle to the TestLink API.
Set Environment Variable TESTLINK_API_PYTHON_CLIENT_PATH ${TESTLINK_API_PYTHON_CLIENT_PATH}
Initiate Testlink Connection ${server_url} ${dev_key}
这里 ${TESTLINK_API_PYTHON_CLIENT_PATH} 变量需要设置为你本地安装 TestLink-API-Python-client 的路径。
- 现在您可以使用
Connect to TestLink Server关键字连接到您的TestLink服务器并执行其他相关操作了。例如:
*** Test Cases ***
My Test Case
[Documentation] This is my test case.
...
Connect to TestLink Server http://localhost/testlink/api/xmlrpc/v1/xmlrpc.php abcdef123456
Create New Build If Not Exists My Project My Plan My Build
Assign Test Case Execution Task to User My Project My Plan My Suite/TestCaseName
Update Test Case Result PASS Notes about the result
这是一个简单的例子,展示了如何使用 TestLinkKeywords 库中的关键字连接到TestLink服务器并执行一些操作。您可以根据需要进行调整和扩展。




