TestLink

Introduction

The current integration of QF-Test with the open-source tool TestLink consists of two parts:

  • Generating template test suites for QF-Test from the planned test cases of TestLink.
  • Importing QF-Test results into TestLink.

3.5.1+If you use TestLink 1.9.4 or newer you can use the TestLink API for interacting with TestLink. The TestLink API requires a valid development key. Therefore open TestLink and go to 'My Settings'. In the settings you can generate a development key by pressing 'Generate key' under the 'API interface' section.

For TestLink 1.9.3 or older versions the integration mechanism accesses the database of TestLink directly. This approach requires a JDBC database driver to use the provided scripts. You can download those drivers from the web page of their providers.

Exporting the planned test cases including its test steps from TestLink to QF-Test supports the test-creator to implement the test cases exactly as planned.

Importing the test results into TestLink provides a better overview over all executed manual and automated tests-cases in one tool.

Note Test results can also be uploaded to TestLink without exporting them before. Therefore you have to take care, that the ID of the test case from TestLink is part of the test case's name in QF-Test. The name has to be called like this: <TestLink-ID>: Name of the test case.

Generating template test suites for QF-Test from test cases

QF-Test offers the capability to generate template test suites following the same structure as the planned tests in TestLink to guarantee a synchronized structure of automated tests and test planning.

In the QF-Test file you can find one 'Test case' node per test case and one 'Test set' node per suite from TestLink. If you have specified the fields "Steps" and "Expected Results" of a test case, the generating-script will also create an empty 'Test step' for each test step in the according test case. The expected result will be shown in the 'Comment' attribute of the 'Test step' node.

Now the template test suite has to be filled by the test automation engineer with the according steps by adding QF-Test steps to the generated 'Test step' nodes.

3.5.1+In case you use TestLink 1.9.4 or newer you need to perform following steps:

  1. Take care that test automation is enabled in TestLink. Therefore set the respective enable_test_automation key to ENABLED in the configuration file config.inc.php.
  2. Copy the folder qftest-7.1.2/ext/testlink/api to a project-specific location.
  3. Open the launcher script you want to use with a text editor. The launcher scripts are exportTests.bat for Windows and exportTests.sh for Unix.
  4. Adapt the paths of the variables JAVA, QFTDIR and TESTLINKINTEGRATOR.
  5. Open the file TestLinkUserSpecifics.py with a text editor.
  6. Adjust the variables serverurl and devkey.
  7. If you want to export custom fields from TestLink, also adjust the variable custom_fields.
  8. Run the adapted export script, like shown below.
exportTests.bat --testproject projectname --targetsuite /path/to/testsuite.qft
Example 26.3:  Sample call of exporting test cases from 1.9.4

If you use TestLink 1.9.3 or older, please perform those steps:

  1. Copy the folder qftest-7.1.2/ext/testlink/export to a project-specific location.
  2. Open the launcher script you want to use with a text editor. The launcher scripts are exportTestLinkToQFT.bat for Windows and exportTestLinkToQFT.sh for Unix.
  3. Adapt the paths of the variables JAVA, QFTDIR and TESTLINKINTEGRATOR.
  4. Open the file TestLinkDBIntegrator.py with a text editor.
  5. Adjust the variables dbdriver, conncetionstr, dbuser and dbpass according to your database connection.
  6. If you want to export custom fields from TestLink, also adjust the variable custom_fields.
  7. Run the adapted export script, like shown below.
exportTestLinkToQFT.bat --testproject projectname --targetsuite /path/to/testsuite.qft
Example 26.4:  Sample call of exporting test cases till 1.9.3

Execution of test cases

Executing the QF-Test tests can be performed as usual. But you should create a XML-report at the end of the test run, because the import mechanism is using this report. Therefore you have to use the '-report.xml' parameter during test execution. If you create the reports via the GUI, you have to check the checkbox 'Create XML report'.

Note In case you did not export test cases from TestLink the ID of the test case from TestLink has to be part of the test case's name in QF-Test. The name has to be called like this: <TestLink-ID>: Name of the test case.

qftest -batch -report.xml reportFolder testsuite.qft
Example 26.5:  Sample execution to create a XML report

Importing QF-Test results into TestLink

After creating the XML report file, you can upload the results to TestLink.

Per default the import mechanism creates a new build for every test run. The build number of TestLink will be created by the run-ID of the QF-Test report. You can change the run-ID, by setting the parameter '-runid' when launching the tests with QF-Test. But you can also set the '-build' parameter during import to specify a custom build name.

3.5.1+In case you use TestLink 1.9.4 or newer you need to perform following steps:

  1. Take care that test automation is enabled in TestLink. Therefore set the respective enable_test_automation key to ENABLED in the configuration file config.inc.php.
  2. Copy the folder qftest-7.1.2/ext/testlink/api to a project-specific location. (If you have copied them already for exporting you can use the same files.)
  3. Open the launcher script you want to use with a text editor. The launcher scripts are importResults.bat for Windows and importResults.sh for Unix.
  4. Adapt the paths of the variables JAVA, QFTDIR and TESTLINKINTEGRATOR.
  5. Open the file TestLinkUserSpecifics.py with a text editor.
  6. Adjust the variables serverurl and devkey. (If you have adapted them already for exporting you can use the same values.)
  7. Run the adapted import script, like shown below.
importResults.bat --testproject projectname
            --resultfile qftestReport.xml --testplan testplanname --platform system1
Example 26.6:  Importing test results into TestLink from 1.9.4

If you want to overwrite the build name you can use the '-build' parameter.>

importResults.bat --testproject projectname
            --resultfile qftestReport.xml --testplan testplanname --platform
            system1 --build myBuild
Example 26.7:  Importing test results into TestLink from 1.9.4 with custom build

If you use TestLink 1.9.3 or an older version, please perform following steps:

  1. Copy the folder qftest-7.1.2/ext/testlink/import to a project-specific location.
  2. Open the launcher script you want to use with a text editor. The launcher scripts are importToTestLink.bat for Windows and importToTestLink.sh for Unix.
  3. Adapt the paths of the variables JAVA, QFTDIR and TESTLINKINTEGRATOR.
  4. Open the file ReportParser.py with a text editor.
  5. Adjust the variables dbdriver, conncetionstr, dbuser and dbpass according to your database connection.
  6. If you want to export custom fields from TestLink, also adjust the variable custom_fields.
  7. Run the adapted import script, like shown below.
importToTestLink.bat --testproject projectname --resultfile qftestReport.xml --testplan testplanname --tester tester
Example 26.8:  Importing test results into TestLink till 1.9.3