cancel
Showing results for 
Search instead for 
Did you mean: 

How to execute project in Test Server with Data sink by making REST API Request?

Occasional Contributor

How to execute project in Test Server with Data sink by making REST API Request?

I am trying to execute project by doing REST API. I am able to execute a project file (xml) by making a post request,

 

 

 

import requests
import json
import xml.dom.minidom

 

xml = xml.dom.minidom.parse('C:\xxx\foo.xml')
data = xml.toprettyxml()

 

headers = {
'access-control-allow-origin': '*',
'accept': 'application/json',
'content-type': 'application/xml',
'authorization': 'Basic xxxxxxxxxxx',
}

params = (
('async', 'true'),
)

R = requests.post('http://testserver:8080/v1/readyapi/executions/xml', headers=headers, params=params, data=data)
print R.content
print R

 

in response, I got 

 

Validation of the project failed with the following messages:
The test step DataSink has a DataSink accessing a local resource and can't be processed by the TestServer

 

Now, I want to send a data file. I see there is a request /readyapi/executions/composite

to send a zip file, but i don't know how to use it. It's saying mention project file name. Then how to pass zip file?

Does anyone used this before? I am doing this in python? can someone share example. 

I am totally new to this product. 

I want to automate test execution and test result by using REST API. So, I can integrate this with CICD process. 

 

Can someone please advice!

Thank you in advance

2018 NEWS