首页 文章

回答未找到TestLink xmlrpc API(通过Python)404

提问于
浏览
0

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

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

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

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

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'

2 回答

  • 0

    编辑testlinkhelper.py文件并更改该行

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

    并将localhost替换为您的服务器ip并检查浏览器中的URL .

  • 1

    我能够使用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

相关问题