You can sync your test automation result in QA Touch directly with the API end points.
Before you start using our API, your first step is to obtain an api-token from your QA Touch site. Once you obtain the token, then you are ready to go.
To Obtain api-token follow the steps below Go to User->Edit profile Under General settings, Click 'Generate API Key' to generate the API key.
(Note: QA Touch API is a Professional and Enterprise Plan feature)
The sample code snippet to update the QA Touch project’s test run result of the test case in
import java.io.*;
import okhttp3.*;
import okio.Okio.*;
public class qatouch {
public static void main(String []args) throws IOException{
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("text/plain");
RequestBody body = RequestBody.create(mediaType, "");
Request request = new Request.Builder()
.url("https://api.qatouch.com/api/v1/testRunResults/status?status=passed&project=JdWL&test_run=EX7V&run_result=k9yl9")
.method("PATCH", body)
.addHeader("api-token", ********API Token********** ")
.addHeader("domain", "****Domain***")
.build();
Response response = client.newCall(request).execute();
System.out.println(response.body().string());
}
}
Dependency Jars/Libraries
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://api.qatouch.com/api/v1/testRunResults/add/results?status=passed&project=PROJECTID&test_run=TESTRUNID&run_result=RESULTID&run_result=RESULTID&comments=API%20Endpoint%20checking×pent=10',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_HTTPHEADER => array(
'api-token: ****************API TOKEN****************************',
'domain: ******************DOMAIN********************************'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
var myHeaders = new Headers();
myHeaders.append("api-token", "***********API Token******************");
myHeaders.append("domain", "***********Domain******************");
var requestOptions = {
method: 'POST',
headers: myHeaders,
redirect: 'follow'
};
fetch("https://api.qatouch.com/api/v1/testRunResults/add/results?status=passed&project=PROJECTID&test_run=TESTRUNID&run_result[]=RESULTID&run_result[]=RESULTID&comments=API Endpoint checking×pent=10", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));
import http.client
conn = http.client.HTTPSConnection("api.qatouch.com")
payload = ''
headers = {
'api-token': '**********API Token*********************',
'domain': '*************Domain************************'
}
conn.request("POST", "/api/v1/testRunResults/add/results?status=passed&project=PROJECTID&test_run=TESTRUNID&run_result=RESULTID&run_result=RESULTID&comments=API%20Endpoint%20checking×pent=10", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import http.client
conn = http.client.HTTPSConnection("api.qatouch.com")
payload = ''
headers = {
'api-token': '**************API TOKEN********************',
'domain': '**************DOMAIN**************************'
}
conn.request("POST", "/api/v1/testRunResults/add/results?status=passed&project=PROJECTID&test_run=TESTRUN&run_result=RESULTID&run_result=RESULTID&comments=API%20Endpoint%20checking×pent=10", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))