While import test results getting error "Couldn't read data from file"

bhuv sai April 21, 2021

I am using import api through curl for test results but getting error that couldn't read json file.

I tried accessing the file using cat command it's accessible but while passing it through api it's not working

 

Command I am Using

curl -D- -u UserName:Password -X POST -d @D:\buildagent1\work\b1faac57a698b688\reports\json\cucumber_report.2140.json https://sereverName/rest/raven/1.0/import/execution/cucumber --header "Content-Type: application/json" -H "Accept: application/json"

 

Error: Warning: Couldn't read data from file Warning: "'D:\buildagent1\work\b1faac57a698b688\reports\json\cucumber_report.2140.json'", this makes an empty POST.

 

 

1 answer

1 accepted

0 votes
Answer accepted
Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
April 22, 2021

It means what it says - the file is not readable.  

It's either not there, not permissioned for you or possibly not well-formed json (although I doubt the last as curl doesn't care what the content of a file is)

bhuv sai April 23, 2021

thanks @Nic Brough -Adaptavist- issue was with wrong quotes in file path :)

Suggest an answer

Log in or Sign up to answer