From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
09-09-2013 02:44 AM
Hi,
Does anyone has successfully communicate Testrail data base with labview? I have faced "Accept header missing (use Accept: application\/json)"} error even though I put application/json in header file. Thanks in advance for your reply.
With Regards,
Tinwin
09-05-2016 06:26 AM
Hi Tinwin
It's been a while since you faced your problem with Testrail. I've been playing with Labview and Testrail few days now and I'm facing same kind of problems you had few years ago.
I'm trying to use LabVIEW HTTP Client VIs: OpenHandle.vi, AddHeader.vi, GET.vi, and CloseHandle.vi. I'm using LabVIEW 2013.
It looks like authentication and header wouldn't go throuht... with the simple example in the attached pic I get following output:
headers:
HTTP/1.1 401 Unauthorized
Content-Type: application/json; charset=utf-8
Server: Microsoft-IIS/8.5
X-Powered-By: PHP/5.6.16
Date: Mon, 05 Sep 2016 11:20:50 GMT
Content-Length: 87
body:
{"error":"Authentication failed: invalid or missing user\/password or session cookie."}
In the example <testrail server> is in form "testrail.company.net".
Anyway, did you ever resolved your issue and do you have some working solution for communicating to Testrail from LabVIEW?
I'll really appreciate if you could share some of your experience here.
Thanks!
/jarnoe
09-06-2016 06:44 AM - edited 09-06-2016 06:47 AM
Hi all
I just resolved the issue I reported yesterday and wanted to share the solution here.
The resolution was not to input username and password to OpenHandle.vi but define them into HTTP header (ref. the attached picture). Header Field Name for that is "Authorization" and value "Basic <username:password coded in Base64>" (ref. https://en.wikipedia.org/wiki/List_of_HTTP_header_fields).
Thanks to Christian_L who shared 'LabVIEW Utility VIs for Base64 and Base32Hex Encoding' (ref. https://decibel.ni.com/content/docs/DOC-5544).
/jarnoe
09-06-2016 08:53 AM
Hello Jarnoe,
Thank you for posting back in this thread with the solution you found for your problem. It will help people in the future if they find this same thread as you did when searching for the same problem.
01-26-2018 03:10 AM
Thanks jarnoe for posting this! It's helped a lot but I'm not quite there yet. What am I missing?
01-26-2018 10:21 AM
Hi FixedWire!
Thanks for asking!
I'll bet the problem is you're filling http header as string and for some reason LabVIEW cannot handle this. If I remember right I tried the same first. I'd recommend trying to fill headers by 'LabVIEWHTTPClient.lvlib:AddHeader.vi' between 'OpenHandle.vi' and 'GET.vi' as in the attached example VI.
Hope this helps forward!
/jarnoe
02-02-2018 04:06 AM
It worked like a charm right after IT got involved and changed a setting to "PHP-FPM". The reason being the basic authentication was not getting routed through. For the login use the user's email & create an API key for the password. And don't forget to click the save after creating the API key otherwise it will not be there.
Thank you jarnoe!
02-06-2018 05:12 AM
No problem FixedWire! It's good to hear you managed to solve your issue.
I've never managed to log in with API key... my system uses password instead. How you define API key in http request header? I need to talk to IT also if they can check that "PHP-FPM" setting in out TestRail system.
06-25-2021 06:06 AM
Hello,
I'm starting to fight with Testrail but I'm not able to connect to it. Can you help me?