[SOLVED]What am I doing wrong - reportTCResult
Posted: Tue Nov 16, 2010 9:48 am
Hi all,
I implemented a small Python script for uploading test-results into TestLink. But my script only updates the first result of the first test-case and not all of them.
Could you tell me, what I am doing wrong?
The method returns with success but I can't see the results updated and I cannot find an execution in the database.
I use TestLink 1.9 (recently released).
Here is my code:
#first test-case
tcextid = "qq-1"
data = {}
data["devKey"] = devkey
data["testcaseexternalid"] = tcextid
tcinfo = server.tl.getTestCase(data)
tcversion = tcinfo[0]['version']
tcid = tcinfo[0]['id']
internaltcid = tcinfo[0]['testcase_id']
print "TCINFO", tcinfo[0]
data = {}
data["devKey"] = devkey
data["testcaseexternalid"] = tcextid
data["testplanid"] = planId
data["overwrite"] = "true"
data["status"] = "p"
data["buildname"] = "myBuild"
uploadResult = server.tl.reportTCResult(data)
#here the result is updated correctly, I can verify this via changing the result to f
print "Upload for qq1", uploadResult
#second test-case doesn't work
tcextid = "qq-2"
data = {}
data["devKey"] = devkey
data["testcaseexternalid"] = tcextid
tcinfo = server.tl.getTestCase(data)
tcversion = tcinfo[0]['version']
tcid = tcinfo[0]['id']
internaltcid = tcinfo[0]['testcase_id']
print "TCINFO", tcinfo[0]
data = {}
data["devKey"] = devkey
data["testcaseexternalid"] = tcextid
data["testplanid"] = planId
data["overwrite"] = "true"
data["status"] = "p"
data["buildname"] = "myBuild"
uploadResult = server.tl.reportTCResult(data)
print "Upload for qq2", uploadResult
#success is reporting, but I cannot see in in the database or in the HTML
Thanks in advance!
Best Regards,
Martin
I implemented a small Python script for uploading test-results into TestLink. But my script only updates the first result of the first test-case and not all of them.
Could you tell me, what I am doing wrong?
The method returns with success but I can't see the results updated and I cannot find an execution in the database.
I use TestLink 1.9 (recently released).
Here is my code:
#first test-case
tcextid = "qq-1"
data = {}
data["devKey"] = devkey
data["testcaseexternalid"] = tcextid
tcinfo = server.tl.getTestCase(data)
tcversion = tcinfo[0]['version']
tcid = tcinfo[0]['id']
internaltcid = tcinfo[0]['testcase_id']
print "TCINFO", tcinfo[0]
data = {}
data["devKey"] = devkey
data["testcaseexternalid"] = tcextid
data["testplanid"] = planId
data["overwrite"] = "true"
data["status"] = "p"
data["buildname"] = "myBuild"
uploadResult = server.tl.reportTCResult(data)
#here the result is updated correctly, I can verify this via changing the result to f
print "Upload for qq1", uploadResult
#second test-case doesn't work
tcextid = "qq-2"
data = {}
data["devKey"] = devkey
data["testcaseexternalid"] = tcextid
tcinfo = server.tl.getTestCase(data)
tcversion = tcinfo[0]['version']
tcid = tcinfo[0]['id']
internaltcid = tcinfo[0]['testcase_id']
print "TCINFO", tcinfo[0]
data = {}
data["devKey"] = devkey
data["testcaseexternalid"] = tcextid
data["testplanid"] = planId
data["overwrite"] = "true"
data["status"] = "p"
data["buildname"] = "myBuild"
uploadResult = server.tl.reportTCResult(data)
print "Upload for qq2", uploadResult
#success is reporting, but I cannot see in in the database or in the HTML
Thanks in advance!
Best Regards,
Martin