The Test Case ID (tcid) provided does not exist!
Moderators: Amaradana, TurboPT, TL Developers
The Test Case ID (tcid) provided does not exist!
Hello all,
In my reportTCResult call I always get the error that the testcase id provided does not exist. I am entering a valid testcase id. What values does the call expect? How do I verify the id in the database?
I look forward to your help.
In my reportTCResult call I always get the error that the testcase id provided does not exist. I am entering a valid testcase id. What values does the call expect? How do I verify the id in the database?
I look forward to your help.
-
- TestLink user
- Posts: 1
- Joined: Thu Apr 02, 2009 3:47 am
The API requires the internal Test Case ID, which is different from the external one you see through the web interface. One sure fire way that worked for me when I was having the same issue was to select the test case in the TestLink web interface, click the button to export the test case in XML and use a free XML editor (such as firstobject) to view the file and get the internal test case ID.
I'm sure there may be better ways of accomplishing this. Personally I would like to be able to report execution results referencing the external test case ID that is displayed and will do the translation programmatically somehow as long as it works this way.
I'm sure there may be better ways of accomplishing this. Personally I would like to be able to report execution results referencing the external test case ID that is displayed and will do the translation programmatically somehow as long as it works this way.
-
- Advanced user
- Posts: 29
- Joined: Mon Aug 18, 2008 11:06 am
Test case not valid still
Hi All,
I using the sameple java client,please find the snippet of the code:
TestlinkAPIXMLRPCClient.testLinkReport(4,2, "p");
Please find the test suite code also:-
<?xml version="1.0" encoding="UTF-8"?>
<testsuite name="" >
<node_order><![CDATA[]]></node_order>
<details><![CDATA[]]>
</details><testsuite name="Test-01" >
<node_order><![CDATA[1]]></node_order>
<details><![CDATA[<p>Test</p>]]>
</details>
<testcase internalid="4" name="Test-TestCase-01">
<node_order><![CDATA[100]]></node_order>
<externalid><![CDATA[1]]></externalid>
<summary><![CDATA[]]></summary>
<steps><![CDATA[]]></steps>
<expectedresults><![CDATA[]]></expectedresults>
</testcase>
</testsuite></testsuite>
I still get an error
Keys: [message, code] values: [No Test Case ID provided. A valid Test Case ID must be provided!, 110]
Testlink version:1.8 RC5 -April 2nd Build.
Request to provide some inputs as soon as possible.
I using the sameple java client,please find the snippet of the code:
TestlinkAPIXMLRPCClient.testLinkReport(4,2, "p");
Please find the test suite code also:-
<?xml version="1.0" encoding="UTF-8"?>
<testsuite name="" >
<node_order><![CDATA[]]></node_order>
<details><![CDATA[]]>
</details><testsuite name="Test-01" >
<node_order><![CDATA[1]]></node_order>
<details><![CDATA[<p>Test</p>]]>
</details>
<testcase internalid="4" name="Test-TestCase-01">
<node_order><![CDATA[100]]></node_order>
<externalid><![CDATA[1]]></externalid>
<summary><![CDATA[]]></summary>
<steps><![CDATA[]]></steps>
<expectedresults><![CDATA[]]></expectedresults>
</testcase>
</testsuite></testsuite>
I still get an error
Keys: [message, code] values: [No Test Case ID provided. A valid Test Case ID must be provided!, 110]
Testlink version:1.8 RC5 -April 2nd Build.
Request to provide some inputs as soon as possible.
-
- Advanced user
- Posts: 29
- Joined: Mon Aug 18, 2008 11:06 am
No Test Case ID provided.valid Test Case ID must be provided
Can you please tell me where is the button located to export the test case in XML so I can get the internal test case ID?
Is there any relation between the web based test case IDs and the one in the testlink database? How do I determine the internal test case ID's in my code if I only know the web based test case IDs?
I look forward to your replies.
Thanks
Is there any relation between the web based test case IDs and the one in the testlink database? How do I determine the internal test case ID's in my code if I only know the web based test case IDs?
I look forward to your replies.
Thanks
-
- Advanced user
- Posts: 29
- Joined: Mon Aug 18, 2008 11:06 am
Hi,
Answers to your queries.
1)Export Test Case is UI part of testlink when u create button test case there is button export test case
2)When you export your test case to xml the ids would be generated.
The external ids which are generated can be used to communicate with your db through API.
As far as my knowledge there is relation between the web based id and the one in the db id.
regards
prashant
Answers to your queries.
1)Export Test Case is UI part of testlink when u create button test case there is button export test case
2)When you export your test case to xml the ids would be generated.
The external ids which are generated can be used to communicate with your db through API.
As far as my knowledge there is relation between the web based id and the one in the db id.
regards
prashant
Re:
Thanks a lot Prashant for your reply. I could do the call gettestcaseIDbyName and it gives me the corresponding test case ID.
This is my XML file
<testsuite name="">
<details>
</details>
−
<testsuite name="apitest">
<details>
</details>
−
<testcase internalid="3" name="api1">
<externalid>
1
</externalid>
<summary>
</summary>
<steps>
</steps>
<expectedresults>
</expectedresults>
</testcase>
−
<testcase internalid="5" name="api2">
<externalid>
2
</externalid>
<summary>
</summary>
<steps>
</steps>
<expectedresults>
</expectedresults>
</testcase>
</testsuite>
−
<testsuite name="1234">
<details>
</details>
−
<testcase internalid="9" name="t1">
<externalid>
3
</externalid>
<summary>
</summary>
<steps>
</steps>
<expectedresults>
</expectedresults>
</testcase>
</testsuite>
</testsuite>
However I still cannot get reportTC result to work. What is the testplanid and buildID required for the call. Where do I get these?
If I go to testplan management page I get this
[ID: 7 ] plan1 but when I enter this id and then the buildname it gives me error
(
[0] => Array
(
This is my XML file
<testsuite name="">
<details>
</details>
−
<testsuite name="apitest">
<details>
</details>
−
<testcase internalid="3" name="api1">
<externalid>
1
</externalid>
<summary>
</summary>
<steps>
</steps>
<expectedresults>
</expectedresults>
</testcase>
−
<testcase internalid="5" name="api2">
<externalid>
2
</externalid>
<summary>
</summary>
<steps>
</steps>
<expectedresults>
</expectedresults>
</testcase>
</testsuite>
−
<testsuite name="1234">
<details>
</details>
−
<testcase internalid="9" name="t1">
<externalid>
3
</externalid>
<summary>
</summary>
<steps>
</steps>
<expectedresults>
</expectedresults>
</testcase>
</testsuite>
</testsuite>
However I still cannot get reportTC result to work. What is the testplanid and buildID required for the call. Where do I get these?
If I go to testplan management page I get this
[ID: 7 ] plan1 but when I enter this id and then the buildname it gives me error
(
[0] => Array
(
Code: Select all
=> 4020
[message] => Guessing is disabled so a buildid must be specified!
)
[1] => Array
(
[code] => 130
[message] => No buildid provided. A valid buildid must be provided!
)
)
I look forward to your reply.
Thanks a lot.
Thanks for your reply.
Where do I get the buildid and planid from? I already tried using buildid from the web interface but I get error No buildid provided. A valid buildid must be provided!
In my earlier post I did send you the xml file It does not have the buildID or the testplan planID. The one I get from the web interface gives me the above error.
I need to know where do I get the buildID, planID and projectID from which I can use in the API calls?
I look forward to your reply.
Thanks
Where do I get the buildid and planid from? I already tried using buildid from the web interface but I get error No buildid provided. A valid buildid must be provided!
In my earlier post I did send you the xml file It does not have the buildID or the testplan planID. The one I get from the web interface gives me the above error.
I need to know where do I get the buildID, planID and projectID from which I can use in the API calls?
I look forward to your reply.
Thanks
I have the same question, help!abadve wrote:Thanks for your reply.
Where do I get the buildid and planid from? I already tried using buildid from the web interface but I get error No buildid provided. A valid buildid must be provided!
In my earlier post I did send you the xml file It does not have the buildID or the testplan planID. The one I get from the web interface gives me the above error.
I need to know where do I get the buildID, planID and projectID from which I can use in the API calls?
I look forward to your reply.
Thanks
-
- Advanced user
- Posts: 29
- Joined: Mon Aug 18, 2008 11:06 am
This is the sequence how I do this:
1. Get the project ID
get all projects :
iterate over the list returned and find the project with the name and use that id.
2. Get TestPlanId
get all testPlans for the project:
iterate over all testPlans until I find the one with the name I am looking for
use that test plan id
3. call ReportTCResult and set the Guess Parameter to true. You then don't have to provide the buildId.
1. Get the project ID
get all projects :
Code: Select all
getProjects(devkey);
2. Get TestPlanId
get all testPlans for the project:
Code: Select all
getProjectTestPlans(devKey, projectid)
use that test plan id
3. call ReportTCResult and set the Guess Parameter to true. You then don't have to provide the buildId.
I tried the API with PHP, but unfortunately, It also didn't work, just as Python.prashant.katti wrote:Hi All,
We have found that there some issues in retriving the TPid and TCid with any API apart from PHP.
We tried using the PHP api there was not error been reported and could automate the process of Test results uploading,
We need to open Mantis for the same.
regards
prashant
I mean that methods without id(tcid, tpid, ..) can work well, like gerProjects (not use any id), but methods using id didn't work, like getPeojectTestPlans (use project id). the following is what i got with PHP script:
Test - getProjectTestPlans $args (array)
devKey eb1a9b4fca215788200bf9587cc69202
testplanid 1
POST /testlink181/lib/api/xmlrpc.php HTTP/1.0
Host: 10.31.22.157
Content-Type: text/xml
User-Agent: Incutio XML-RPC
Content-length: 336
<?xml version="1.0"?>
<methodCall>
<methodName>tl.getProjectTestPlans</methodName>
<params>
<param><value><struct>
<member><name>devKey</name><value><string>eb1a9b4fca215788200bf9587cc69202</string></value></member>
<member><name>testplanid</name><value><int>1</int></value></member>
</struct></value></param>
</params></methodCall>
<?xml version="1.0"?>
<methodResponse>
<params>
<param>
<value>
<array><data>
<value><struct>
<member><name>code</name><value><int>160</int></value></member>
<member><name>message</name><value><string>No testprojectid provided. A valid test project id must be provided!</string></value></member>
</struct></value>
</data></array>
</value>
</param>
</params>
</methodResponse>
Rsult was: $response (array)
0 array
code 160
message No testprojectid provided. A valid test project id must be provided!
Test - getProjects$args (array)
devKey eb1a9b4fca215788200bf9587cc69202
POST /testlink181/lib/api/xmlrpc.php HTTP/1.0
Host: 10.31.22.157
Content-Type: text/xml
User-Agent: Incutio XML-RPC
Content-length: 258
<?xml version="1.0"?>
<methodCall>
<methodName>tl.getProjects</methodName>
<params>
<param><value><struct>
<member><name>devKey</name><value><string>eb1a9b4fca215788200bf9587cc69202</string></value></member>
</struct></value></param>
</params></methodCall>
<?xml version="1.0"?>
<methodResponse>
<params>
<param>
<value>
<array><data>
<value><struct>
<member><name>id</name><value><string>1</string></value></member>
<member><name>notes</name><value><string><p>This is an inner project aiming at auto documetation</p></string></value></member>
<member><name>color</name><value><string></string></value></member>
<member><name>active</name><value><string>1</string></value></member>
<member><name>option_reqs</name><value><string>0</string></value></member>
<member><name>option_priority</name><value><string>0</string></value></member>
<member><name>option_automation</name><value><string>0</string></value></member>
<member><name>prefix</name><value><string>MAD</string></value></member>
<member><name>tc_counter</name><value><string>3</string></value></member>
<member><name>name</name><value><string>Mars-AD</string></value></member>
</struct></value>
<value><struct>
<member><name>id</name><value><string>11</string></value></member>
<member><name>notes</name><value><string><p>This project is used update case in TestLink 1.7.4 to TestLink 1.8.1</p></string></value></member>
<member><name>color</name><value><string></string></value></member>
<member><name>active</name><value><string>1</string></value></member>
<member><name>option_reqs</name><value><string>0</string></value></member>
<member><name>option_priority</name><value><string>0</string></value></member>
<member><name>option_automation</name><value><string>0</string></value></member>
<member><name>prefix</name><value><string>TLCupdate</string></value></member>
<member><name>tc_counter</name><value><string>142</string></value></member>
<member><name>name</name><value><string>TestLink Update</string></value></member>
</struct></value>
</data></array>
</value>
</param>
</params>
</methodResponse>
Rsult was: $response (array)
0 array
id 1
notes pThis is an inner project aiming at auto documetation/p
color [empty string]
active 1
option_reqs 0
option_priority 0
option_automation 0
prefix MAD
tc_counter 3
name Mars-AD
1 array
id 11
notes pThis project is used update case in TestLink 1.7.4 to TestLink 1.8.1/p
color [empty string]
active 1
option_reqs 0
option_priority 0
option_automation 0
prefix TLCupdate
tc_counter 142
name TestLink Update
[/img]