【问题标题】:Answer to TestLink xmlrpc API (via Python) 404 not found未找到对 TestLink xmlrpc API(通过 Python)404 的回答
【发布时间】:2013-12-06 04:55:42
【问题描述】:

由于我没有足够的声誉,我可以回答以下问题:

我正在尝试通过 xmlrpc API 连接到 TestLink。我在 TestLink 的 config.inc.php 中设置了以下内容:

$tlCfg->api->enabled = TRUE;
$tlCfg->exec_cfg->enabled_test_automation = ENABLED;

并重新启动 apache 服务器。我尝试通过python包TestLink-API-Python-client(https://github.com/orenault/TestLink-API-Python-client)连接TestLink服务器

from testlink import TestlinkAPIClient, TestLinkHelper
import sys

URL = 'http://MYSERVER/testlink/lib/api/xmlrpc.php'
DevKey = 'MYKEY'

tl_helper = TestLinkHelper()
myTestLink = tl_helper.connect(TestlinkAPIClient) 
myTestLink.__init__(URL, DEVKEY)

myTestLink.checkDevKey()

然后我收到一个 TLConnectionError,说明我的网址和 404 Not Found...

有人知道吗?

谢谢。

回答:从 URL 中删除“testlink”。例如:

URL = 'http://MYSERVER/lib/api/xmlrpc.php'

【问题讨论】:

    标签: python xml-rpc testlink


    【解决方案1】:

    编辑 testlinkhelper.py 文件并更改行

    "DEFAULT_SERVER_URL  = http://localhost/testlink/lib/api/xmlrpc/v1/xmlrpc.php"
    

    用你的服务器ip替换本地主机,并在浏览器中检查URL。

    【讨论】:

      【解决方案2】:

      我能够使以下内容与 TestLink 1.9.3 一起使用(我的公司使用旧版本 - 我认为当前的 TL 版本是 1.9.12)。我正在使用最新的 Python TestLink API 版本 0.5.2。请更改以下代码的服务器 url 和 dev 密钥。另请注意,我使用 https 而不是 http 连接到 xmlrpc 文件。

      import testlink
      TESTLINK_API_PYTHON_SERVER_URL="https://testlink/etc/etc/etc"
      TESTLINK_API_PYTHON_DEVKEY="someapikey"
      
      tls = testlink.TestLinkHelper( TESTLINK_API_PYTHON_SERVER_URL, TESTLINK_API_PYTHON_DEVKEY ).connect(testlink.TestlinkAPIClient)
      print tls.countProjects()
      tc_info = tls.getTestCase(None, testcaseexternalid='S-10000')
      print tc_info
      print tls.whatArgs('createTestPlan')
      

      I also posted it as an issue here

      【讨论】:

        猜你喜欢
        • 2013-05-04
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2021-01-21
        • 1970-01-01
        • 1970-01-01
        • 2020-01-22
        • 2015-07-08
        相关资源
        最近更新 更多