The TestLink add-in (TLAddin) can be used either independently or with TMX. This page describes how to use the add-in for basic TestLink management.
The TestLink instance might be a ready-to-use BitNami instance or an instance that you set up.

Loading the module

ipmo [path]\TLAddin.dll

Connect to TestLink

In case you are running a BitNami instance, username and password of a default user are 'user' and 'bitnami', respectively. In the general case, user name and password for the default user are both 'admin'.
TestLink001.jpg
TestLink002.jpg
TestLink003.jpg
You need to have so-called api key. To obtain the key, log in to TestLink, click on the link 'My Settings' and in the section 'API interface' copy the value of the parameter 'Personal API access key'.
By default, TestLink may not expose the key. This link recommends to set the following setting in the file:
$tlCfg->api->enabled = TRUE;
The -Server parameters is a hostname, FQDN or IP of your TestLink:
Connect-TLServer -Server 10.30.46.76 -ApiKey 34275b86d143acaef5b2175ce840e598
To ensure that you are connected, you might check the following object:
[TMX.TLAddinData]::CurrentTestLinkConnection; # should be not null
or run the following method:
[TMX.TLAddinData]::CurrentTestLinkConnection.about();

Projects

You can obtain a project of your interest in two ways. By name, as follows:
Get-TLProject -Name project01,project02;
# or simply
Get-TLProject project01,project02;
or by getting all the projects and further filtering:
Get-TLProject | ?{ $_.name -eq 'project01' }
There is also a way to get project(s) by its(their) ids:
Get-TLProject -Id prj1,prj2;
The last project is stored in the following variable:
[TMX.TLAddinData]::CurrentTestProject;
Please note that if you use the Get-TLProject cmdlet without parameters, even if you filter the output, the last project issued by the cmdlet will be set the current one. In the above sample, you get the 'project01' project to the pipeline, but the project 'project02' might be (or not be) set the current project.
In the first example, the project 'project02' will be the current as it is being returned last.

Test plans

You can get test plan(s) by many ways. Getting a test plan or test plans from the current project:
Get-TLTestPlan -TestPlanName 'test plan 001';
# or
Get-TLTestPlan -Name 'test plan 001';
# or
Get-TLTestPlan 'test plan 001';
# all test plans in the current project
Get-TLTestPlan;
# a test plan from the current project (explicitly)
[TMX.TLAddinData]::CurrentTestProject | Get-TLTestPlan -Name 'test plan 01';
# getting several test plan by name is also possible
Get-TLTestPlan 'test plan 001','test plan 002';
Alternatively, you can get test plan(s) from project(s) as shown below:
Get-TLProject -Name project01 | Get-TLTestPlan;
Get-TLProject -n project01,project02 | Get-TLTestPlan -Name 'test plan 01'; # fails if there's no such test plan on any of projects - is this acceptable behavior?
Get-TLProject | Get-TLTestPlan -Name 'test plan 01'; # there's currently a bug
To create a test plan do one of the following:
New-TLTestPlan -Name 'test plan aaa' -Description aaaaa -Active; # now this doesn't work
Get-TLProject -n project01 | New-TLTestPlan -Name 'test plan aaa' -Description aaaaa -Active
[TMX.TLAddinData]::CurrentTestProject | New-TLTestPlan -Name 'test plan bbb' -Description bbbbb -Active
New-TLTestPlan -Name 'test plan ccc' -Description ccccc -Active -TestProjectName project01 # there's a bug now: it creates a test plan in the current project

Builds

There is the Add-TLBuild cmdlet and there should be the Get-TLBuild cmdlet too (just forgotten). Let's create a build:
Add-TLBuild -Description buildy -Name 1.2.3.4 # this doesn't work for now
Add-TLBuild -Description buildy -Name 1.2.3.4 -InputObject ([TMX.TLAddinData]::CurrentTestPlan)
# the same as previous
[TMX.TLAddinData]::CurrentTestPlan | Add-TLBuild -Description buildy -Name 1.2.3.5
# creating a build for every test plan of the current project
Get-TLTestPlan | Add-TLBuild -Description mass-creation -Name 1.1.1.1

Test suites

There are several ways to get test suites. From the current project (only first-level test suites):
Get-TLTestSuite;
From the specified project(s) - also only first-level test suites:
Get-TLProject -n project01 | Get-TLTestSuite;
Get-TLProject -n project01,project02,project03 | Get-TLTestSuite;
From test plan(s):
Get-TLTestPlan | Get-TLTestSuite;
Get-TLTestPlan -Name 'test plan 01' | Get-TLTestSuite;
Get-TLTestPlan -Name 'test plan 01' | Get-TLTestSuite -TestSuiteName suite1,suite2; # this doesn't work now
From upper-level test suites:
Get-TLTestSuite | Get-TLTestSuite;
Get-TLProject -Name project02 | Get-TLTestSuite | Get-TLTestSuite;
Please note that gathering test suites from the project level and from test plans may return different results (I don't know exactly whether this is a bug or some test suites are grown directly from test plans).

Test cases

# not at the moment

Test platforms

# there's none for now

Last edited Feb 3, 2013 at 8:11 PM by josekardano, version 22

Comments

No comments yet.