MantisBT - TestLink
View Issue Details
0008327TestLinkAPI - XMLRPCpublic2018-07-09 13:402018-07-12 09:02
dreamwhite 
 
normalfeature requestalways
feedbackopen 
Ubuntu 18.04 Kernel4.15.0-24
1.9.17 (2018 Q1) 
 
MySQL Ver 14.14 Distrib 5.7.22, for Linux (x86_64)
Google Chrome 67.0.3396.99 (Official Build) (64-bit)
PHP 7.2.7-0ubuntu0.18.04.2 (cli)
TBD
0008327: Unable to get the fk_id for uploading attachments to the single step of testcase
Using the Testlink API Client of Python (https://github.com/lczub/TestLink-API-Python-client/ [^]) I'm not able to upload an attachment to a single step.

tls.uploadAttachment('%s' % filename, fk_id, 'execution_tcsteps')

I need the fk_id. I've tried to get from the last execution but the XMLRPC API doesn't return anything
FKID, XMLRPC
png Selection_031.png (27,681) 2018-07-10 13:25
http://mantis.testlink.org/file_download.php?file_id=4956&type=bug
png
Issue History
2018-07-09 13:40dreamwhiteNew Issue
2018-07-09 16:13fmanNote Added: 0027673
2018-07-09 16:13fmanStatusnew => feedback
2018-07-09 16:14fmanQA Team - Task Workflow Status => TBD
2018-07-09 16:14fmanPriorityimmediate => normal
2018-07-09 16:16dreamwhiteNote Added: 0027674
2018-07-09 16:16dreamwhiteStatusfeedback => new
2018-07-09 18:03fmanNote Added: 0027675
2018-07-10 10:55dreamwhiteNote Added: 0027681
2018-07-10 12:34fmanNote Added: 0027683
2018-07-10 13:04dreamwhiteNote Added: 0027684
2018-07-10 13:06fmanNote Added: 0027685
2018-07-10 13:20dreamwhiteNote Added: 0027686
2018-07-10 13:21dreamwhiteTag Attached: FKID
2018-07-10 13:21dreamwhiteTag Attached: XMLRPC
2018-07-10 13:25dreamwhiteFile Added: Selection_031.png
2018-07-11 20:58fmanNote Added: 0027687
2018-07-11 20:58fmanSeverityblock => feature request
2018-07-11 21:08fmanStatusnew => feedback

Notes
(0027673)
fman   
2018-07-09 16:13   
We do not are responsible for python client
please test with the sample clients PHP, and provide feedback
(0027674)
dreamwhite   
2018-07-09 16:16   
Just tested on PHP sample clients provided by TL and the result is still the same. I can't get the FK_ID
(0027675)
fman   
2018-07-09 18:03   
please provide detailed steps to reproduce.
(0027681)
dreamwhite   
2018-07-10 10:55   
Used another language (below JAVA). I need the fkId for uploading the attachment. I know the other parameters.

public Attachment uploadAttachment(Integer fkId, String fkTable, String title, String description, String fileName,
            String fileType, String content) throws TestLinkAPIException {
        return this.miscService.uploadAttachment(fkId, fkTable, title, description, fileName, fileType, content);
    }
(0027683)
fman   
2018-07-10 12:34   
please again:
please provide detailed steps to reproduce.

without requested info I'm going to close issue
(0027684)
dreamwhite   
2018-07-10 13:04   
*downloads the file from https://github.com/kinow/testlink-java-api/blob/master/src/main/java/br/eti/kinoshita/testlinkjavaapi/TestLinkAPI.java* [^]
*edits the infos about the server and the dev key*

Compile it with javac TestLinkApi.java and then java TestLinkApi.class

The code works but only if I provide the fkId statically. I want to get it automatically from the API but I don't know how.
(0027685)
fman   
2018-07-10 13:06   
I need steps FROM LOGICAL POINT OF VIEW I can test only on PHP
(0027686)
dreamwhite   
2018-07-10 13:20   
Step 1: Reports test case result with reportTCResult(tcid, tpid, buildname, status, notes, platform, execduration, timestamp, steps)
Step 2: Uploads the attachment with uploadAttachment(file_path, fkid, fktable)
The error is in the latest API call where I need the fkid dynamically. I can't pass it as a static value. If I need to upload 8 screenshot I can't guess the fkid.
(0027687)
fman   
2018-07-11 20:58   
there is no method to get exec id for a step, you will need to change reportTCResult to return exec id for each step or create a method that using test case exec ID, will return info about exec id for each test case step execution
Meanwhile, your workaround is to use the whole test case exec ID (if reportTCResult() returns it) and attach all files to it