Copyright 2011-2013 James Stock, Olivier Renault, Luiko Czub, TestLink-API-Python-client developers
License Apache License 2.0
TestLink-API-Python-client is a Python XMLRPC client for the TestLink API.
Initially based on the James Stock testlink-api-python-client R7 and Olivier Renault JinFeng idea - an interaction of TestLink, Robot Framework and Jenkins.
TestLink-API-Python-client delivers two main classes
TestlinkAPIGeneric - Implements the Testlink API methods as generic PY methods with error handling.
- Allows the configuration of arguments for these API method as positional or optional arguments.
TestlinkAPIClient - Inherits Testlink API methods from the generic client TestlinkAPIGeneric and defines service methods like "countProjects".
- Change the configuration for positional and optional arguments in a way, that often used arguments are positional (consistent with v0.4.0).
src/
- Source for TestLink API Python Client
tests/
- Unit Tests for TestLink API Python Client
examples/
- Examples, how to use the TestLink API Python Client
The testLink configuration (config.inc.php or custom_config.inc.php) must have enabled the api interface
- $tlCfg->api->enabled = TRUE;
The user specific devKey are created inside TestLink, see
- My Settings -> API interface - Personal API access key [Generate a new key]
[PYTHON27]\Scripts\virtualenv [PYENV]\testlink [PYENV]\testlink\Scripts\activate pip install TestLink-0.4.5-RC1.zip [PYENV]\testlink\Scripts\activate python example\TestLinkExample.py --server_url http://[YOURSERVER]/testlink/lib/api/xmlrpc.php --devKey [Users devKey generated by TestLink] [PYENV]\testlink\Scripts\activate python example\TestLinkExampleGenericApi.py --server_url http://[YOURSERVER]/testlink/lib/api/xmlrpc.php --devKey [Users devKey generated by TestLink] [PYENV]\testlink\Scripts\activate set TESTLINK_API_PYTHON_SERVER_URL=http://[YOURSERVER]/testlink/lib/api/xmlrpc.php set TESTLINK_API_PYTHON_DEVKEY=[Users devKey generated by TestLink] cd test\utest python -m unittest testlinkapicallservertest testlinkapi_online_test [PYENV]\testlink\Scripts\activate cd test\utest python -m unittest testlinkhelpertest testlinkapi_offline_test The SERVER_URL path has changed with TestLink 1.9.7. Use http://[YOURSERVER]/testlink/lib/api/xmlrpc/v1/xmlrpc.php
see Releases
- please read v0.4.5 release notes for changes between v0.4.0 and v0.4.5
Questions, Enhancements, Issues are welcome under Issues
For (nearly all) implemented API methods you find in example/TestLinkExample.py an example, which although prints the reponse.
The Teslink API Client could be ask, what arguments a API method expects
import testlink tlh = testlink.TestLinkHelper() tls = tlh.connect(testlink.TestlinkAPIClient) print tls.whatArgs('createTestPlan') createTestPlan(<testplanname>, <testprojectname>, [note=<note>], [active=<active>], [public=<public>], [devKey=<devKey>]) create a test plan or a description of all implemented API method could be generated
import testlink tlh = testlink.TestLinkHelper() tls = tlh.connect(testlink.TestlinkAPIClient) for m in testlink.testlinkargs._apiMethodsArgs.keys(): print tls.whatArgs(m), '\n' - James Stock, Olivier Renault
- g4l4drim, pade, lczub, anton-matosov, citizen-stig
- anyone forgotten?