Help Index
TestComplete Website
Does Testuff have an automation API?
Yep! It allows your automation to update test results in Testuff. Automation can also be used to automatically export your data.
How does it work?
Via HTTP POST over SSL. Your Testuff login details are used for identification. Each test has a unique ID. Test results are POSTed to the relevant API URL and include – as parameters – the test ID, lab name, and test result. Following the request, Testuff updates the test result accordingly.Sample: TestComplete (VB format)
Sub Test1()
'Clicks at point (74, 14) of the 'ZapMainForm' object.
Call Aliases.Skype.ZapMainForm.Click(74, 14)
'Clicks at point (56, 19) of the 'TChatRichEdit' object.
Call Aliases.Skype.ZapMainForm.Conv_1554.TChatEntryControl.TChatRichEdit.Click(56, 19)
'Enters 'hello[Enter]' in the 'TChatRichEdit' object.
Call Aliases.Skype.ZapMainForm.Conv_1554.TChatEntryControl.TChatRichEdit.Keys("hello[Enter]")
' Calling Testuff here - don't forget to change the URL, USER and PASSWORD
URL = "https://serviceX.testuff.com/api/v0/run/"
USER = "testuff_login"
PASSWORD = "password"
Set objHTTP = CreateObject("MSXML2.XMLHTTP")
objHTTP.Open "POST", URL, False, USER, PASSWORD
objHTTP.setRequestHeader "Content-type", "application/json"
' replace test ID with correct value from Testuff
s_test_id = "TEST_ID"
s_status = "failed"
s_steps_failed = "1,3"
s_comment = "Test"
strJSON = "{" + _
Chr(34) + "test_id" + Chr(34) + ":" + Chr(34) + s_test_id + Chr(34) +_
"," + Chr(34) + "status" + Chr(34) + ":" + Chr(34) + s_status + Chr(34) +_
"," + Chr(34) + "steps_failed" + Chr(34) + ":" + Chr(34) + s_steps_failed + Chr(34) +_
"," + Chr(34) + "comment" + Chr(34) + ":" + Chr(34) + s_comment + Chr(34) + _
"}"
objHTTP.send (strJSON)
' MsgBox objHTTP.Status
if objHTTP.Status <> "201" Then
MsgBox objHTTP.ResponseText
Else
MsgBox "Created"
End If
End Sub
