html tool

2016年9月11日星期日

testlink中添加dev key

问题:
使用Testlink api 要求添加devKey如下:
参见:https://github.com/lczub/TestLink-API-Python-client/blob/master/doc/usage.rst
[PYENV]\testlink\Scripts\activate
set TESTLINK_API_PYTHON_SERVER_URL=http://[YOURSERVER]/testlink/lib/api/xmlrpc/v1/xmlrpc.php
set TESTLINK_API_PYTHON_DEVKEY=[Users devKey generated by TestLink]
python
>>> import testlink
>>> tls = testlink.TestLinkHelper().connect(testlink.TestlinkAPIClient)
>>> tls.countProjects()

解决:
add:http://www.softwaretestingconcepts.com/test-automation-using-testlink-xmlrpc-api-steps-and-sample-python-client-program

Steps to enable Testlink API via xmlrpc and generate dev key:

  1. Open config.inc.php
  2. Search for  /** XML-RPC API availability (disabled by default) */ $tlCfg->api->enabled = FALSE;
  3. Change FALSE to TRUE $tlCfg->api->enabled = TRUE;
  4. Save config.inc.php
  5. Login to Testlink UI as admin
  6. Go to 'My Settings'
  7. Under API interface, click 'Generate new key'
  8. Copy the key generated
  9. Substitute your newly generated devKey in the client program Example: client = TestlinkAPIClient(devKey="abc04556463cd813a1ea05caf042d42f")
This should be sufficient for a test the Testlink xmlrpc API client server communication. You can then go ahead and use the client program as a library to be called from within your python test scripts (talking from a Selenium python user perspective). You could do similar implementation with other scripts.
Hope you find this useful.

没有评论:

发表评论