Importing and Exporting Test case/Test Suite in TestLink

In the last chapter, we discussed generating Test Reports in Testlink tool. In this chapter, we are going to discuss exporting and importing test case/ test suite in Testlink tool. Testlink tool has the provision with which you can easily export your test cases or test suites present in your Testlink and then you can easily import them into another remote or external Testlink project which is hosted on a different server or system.

 

Steps to generate a Test Report in Testlink tool:

We can export our current test case or test suite from Testlink and import it into remote or another Testlink present on other server or system by simply following these steps.

Step 1: Bring up the Testlink application

Open the XAMPP console and click on the Start buttons for Apache Web Server and MySQL. After Apache Web server and MySQL database are started, you can see their status on XAMPP control panel as shown below. Apache and MySQL elements on XAMPP control Panel have turned green which demonstrate the port number.

Note:  When you want to stop or restart the Apache Web Server and MySQL database then you can simply click on the Stop button to complete the required action.

 

Importing and Exporting Test Cases

 

Step 2: Login into the TestLink application with admin or appropriate role

Make sure that the role with which you are going to login into Testlink tool should have appropriate access to write requirements. Once Apache Web server and MySQL database are up and running, you can access the TestLink application at the below URL on your local machine.

http://localhost/testlink-1.9.16/login.php

Shown below is the login page for TestLink tool. Enter username and password as admin and admin respectively in order to log into the application.

After successful login, it will take you to the home page of the TestLink tool as shown below.

 

Step 3: Click on the “Test Specification” link present on the left-hand side bottom of the home page. It will open a new panel as shown below.

 

Step 4: Click on the “TL-1: Test Case 1” link present on the left-hand side of the panel at the bottom as shown below.

 

Step 5: It will open up “Test case” page on the right-hand side of the panel. Click on the settings button present on the top left-hand corner of the right-hand side panel. It will display the number of buttons including “Export” button as shown below.

 

Step 6: Click on the “Export” button. It will open a new page on the right-hand side panel as shown below.

On the Export page, you will be asked to fill the following fields.

  1. Export filename: You can provide a customized file name, which will be the filename of the exported content.
  2. File type: You can choose the file type. Here we have chosen the file type as XML format.
  3. Options to be exported: Below are the available options which you can choose to be exported into the XML file by simply checking a checkbox which is present opposite to the option.
  • Export Test Case external ID
  • With Test Case prefix
  • Export Test Case Summary
  • Export Test Case Preconditions
  • Export Test Case Steps
  • Export Requirements
  • Export Custom fields
  • Export with keywords

 

Step 7: Click on the “Export” button present at the bottom of the export page. It will start downloading of the XML file. The downloaded XML file has the following contents.

S No. XML Content exported in a XML file
1.

2.

3.

4.

5.

6.

7.

8.

9.

10.

11.

12.

13.

14.

15.

16.

17.

18.

19.

20.

21.

22.

23.

24.

25.

26.

27.

28.

29.

30.

31.

32.

33.

34.

35.

36.

37.

38.

39.

<?xml version=”1.0″ encoding=”UTF-8″?>

 

<testcases>

<testcase internalid=”4″ name=”Test Case 1″>

<node_order><![CDATA[1000]]></node_order>

<externalid><![CDATA[1]]></externalid>

<fullexternalid><![CDATA[TL-1]]></fullexternalid>

<version><![CDATA[1]]></version>

<summary><![CDATA[<p>This is a sample Test case 1 under Test suite1.</p>

]]></summary>

<preconditions><![CDATA[<p>None.</p>

]]></preconditions>

<execution_type><![CDATA[1]]></execution_type>

<importance><![CDATA[2]]></importance>

<estimated_exec_duration></estimated_exec_duration>

<status>1</status>

<is_open>1</is_open>

<active>1</active>

<steps>

<step>

<step_number><![CDATA[1]]></step_number>

<actions><![CDATA[<p>Execute</p>

]]></actions>

<expectedresults><![CDATA[<p>Execute</p>

]]></expectedresults>

<execution_type><![CDATA[1]]></execution_type>

</step>

</steps>

<requirements>

<requirement>

<req_spec_title><![CDATA[New Requirement for Test Case]]></req_spec_title>

<doc_id><![CDATA[DOC1]]></doc_id>

<title><![CDATA[Hello World]]></title>

</requirement>

</requirements>

</testcase>

</testcases>

 

Importing Test case/ Test suite into external Testlink on other Server:

In the last step, we were able to download XML file which has content of the “TL-1: Test Case 1”. Now, we are going to demonstrate the steps which should be followed on another TestLink tool in order to import this Test case on that system.

Step 1: On another TestLink tool, click on the “Test Specification” link and on the next page select the Test suite folder (say “Testlink Suite 1”) under which you want to import the test case which was exported as an XML file.

 

Step 2: Click on the settings button which will display a number of icons under the title “Test suite operations” and “Test case operations” as shown below.

 

Step 3: Click on the “import” icon present under “Test Case Operations”. It will open up a new page where it will ask you to choose XML file in order to import a test case into the current test suite. Also, there are checks available for the duplicate test case and what action should be taken in case TestLink encounters duplicate test case based on name, internal id or external id. In the case of duplicate test, actions available are “create a new test case with a different title”, “update data on latest version”, and “create a new version”. Here, we have chosen duplication based on test case name, and action taken is to create a new test case with a different title.

 

Step 4: Click on the “Upload file” button in order to complete import of the test case on the current TestLink tool. After successful import, you will notice below screen which displays the message as “Test Case: Test Case 1: Created with the title (20180128-20:29:12 Test Case 1)”.

 

Conclusion

In this chapter, we discussed exporting a test case from a TestLink tool and importing that test case under a Test Suite present on another TestLink tool which is hosted on other server or system.

 

Check out all articles in one page if you missed any article in TestLink tutorial series.

TestLink Tutorial Series For Beginner to Advanced

Thank You!

 

1 thought on “Importing and Exporting Test case/Test Suite in TestLink”

Leave a Comment

Share This Post