TestLink_XMLRPCClient is a project dedicated to test automation using jointly TestLink (a Test Management Tool) and testNG. /****************************************************************************************/ TestLink_XMLRPCClient content: sources files: ./src ant file: build.xml (goes along with build.properties.template and MANIFEST.MF.template) this read-me file: READ-ME.txt an example of configuration file: configurationFile.conf.example a directory containing the files to change in TestLink an archive containing some JAR files required for building the project: lib4testlink.tar.gz /************************ TESTLINK changes *****************************************/ Some changes must be brought to your TestLink instance to used properly this framework testlinkModifiedFiles repository contains all the file you need to replace from Testlink directory, replace ./lib/api/xmlrpc.php and ./lib/functions/testplan.class.php To allow automation functionalities in TestLink, some changes of configuration are required. These changes must be made in your custom_config.inc.php file (see base directory and Testlink); in this way, changes will be kept from a version of Testlink to another TestNG is used to run tests, possible results are FAIL, PASS and SKIP which are translate in TestLink terms by failed, passed and not available If you want to see "skipped" on screen instead of "not available", also replace ./locale/en_GB/strings.txt /************************** BEFORE RUNNING TESTS *************************************/ Choose the project you want to execute, note its prefix and active all the test plans you want to run within this project Before you use this framework make sure - You are at least "tester" in TestLink role hierarchy - Your tests are properly specified in TestLink: http://testlink.ihe-europe.net * For each project, a prefix is defined and unique * Automation is allowed for the current project (check "Automation" in new project creation page) * For each test, the execution type is set to automated * For each test, custom fields "class" and "method" are correctly filled in * At least one test plan is created, has a unique name (in project) and is active * At least one build is created for the current test plan (if not, a new one will be automatically created, its name must be changed later) * All the tests you want to execute are linked to an active test plan --> in Specification panel, for each test press on "add to test plan" or go to the Home page->add/remove test cases -> selected the required test plan and add test cases - The method to execute for each test is properly configured to be run by testNG * Check eventual parameters, dependencies, names ... - Configuration parameters are properly set: a configuration file is used for configuring the application. A template is available: configurationFile.conf.example - By configuring properly your build.properties file (see build.properties.template), this configuration file will be automatically generated at compilation. * Your dev_key (devKey) (access key) is required to use TestLink API, generate a key in your Personal panel in Testlink --> log in TestLink -> Personal -> API interface -> generate a new key * For some operations, an administrator access key (AdminDevKey) is required. Ask for it to your TestLink administrator * Server URL is the location for file xmlrpc.php which contains methods of TestLink API. Usually, this file is located in the directory lib/api of TestLink. --> !! check for access rights * TestNG Output Directory is the directory when you want the application to store testNG files results --> !! make sure the access rights are sufficient for the application to access this directory * TestNG results file is the XML file containing all the results (by default is testng-results.xml and it is stored in TestNG Output Directory) * Each XML result file is copied into the upload_area of testlink. Set the path to this directory in $UPLOAD_AREA. * When a test fails, the message returned by testNG is printed beside test status. testNG also returns the full stack trace. If you want this trace to appear in results table, set LOG_FULL_STACKSTRACE to true, false otherwise. * Glue Character is required to retrieve test cases external ids. This latter is made up of the project prefix and an internal id "glue" with a character that can be configure in custom_config.inc.php of TestLink --> by default it is equal to "minus" (-) character Finally, make sure all the classes and methods you mention in TestLink Specification exist and are available /*********************************** RUNNING TESTS ********************************************/ Run the tests automatically: java -jar LaunchTestsWithTestlink.jar prefix configFile with * prefix, the one given to the project to execute * configFile, path to the configuration File Example: $ java -jar dist/LaunchTestsWithTestLink.jar test configurationFile.conf This will execute all the active versions of test cases linked to the active Test Plans of the chosen project. /************************************* SEEING RESULTS *********************************************/ For each test, a result is sent back: passed, failed or skipped. If result status is equal to failed, the message returns by testNG is copied into "notes" field. For each executed test plan, the associated testNG result file (XML) is stored in the upload_area of Testlink. To access them visit http://pathToTestlink/upload_area/projectprefix