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.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Testrail with Labview!

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

0 Kudos
Message 1 of 9
(4,485 Views)

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

0 Kudos
Message 2 of 9
(4,196 Views)

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

Message 3 of 9
(4,170 Views)

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.

0 Kudos
Message 4 of 9
(4,151 Views)

Thanks jarnoe for posting this! It's helped a lot but I'm not quite there yet. What am I missing?

Download All
0 Kudos
Message 5 of 9
(3,953 Views)

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

Download All
Message 6 of 9
(3,931 Views)

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!

0 Kudos
Message 7 of 9
(3,903 Views)

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.

0 Kudos
Message 8 of 9
(3,891 Views)

Hello,

I'm starting to fight with Testrail but I'm not able to connect to it. Can you help me?

0 Kudos
Message 9 of 9
(2,533 Views)