Ask a Question

Smart Assertions - Metadata and case sensitive header names

SOLVED
vorokai
Occasional Contributor

Smart Assertions - Metadata and case sensitive header names

Smart Assertions - Metadata and case sensitive header names

 

I've recently have found out that smart assertions seems to be case sensitive to header name. For example there are two web-servers. Both of them sends the same response header but one sends it like 'Access-Control-Allow-Origin' and another like 'access-control-allow-origin'. Such difference brings different results: for one web-server it passes successfully, and for the other it fails. 

Is there any thoughts or existing request about adding an option for header name case sensitivity (like for values) in "Smart Assertion"?

7 REPLIES 7
mattb
Staff

Hi,

In the smart assertion there is a Case Sensitive checkbox, I would just uncheck that node for your validations: 

https://support.smartbear.com/readyapi/docs/testing/assertions/reference/property/smart-assertion.ht...l

vorokai
Occasional Contributor

@mattb I am afraid it is not what I am looking for.

I am talking about access to header via it "name" and not about header "value" comparison (where case-sensitive checkbox is present and works as expected)

If two requests return response headers with different case registry - smart assertion does not work correctly.

 

Web server 1 returns:  Access-Control-Allow-Origin

Web server 2 returns:  access-control-allow-origin

 

In this case, smart assertion that was set to get "Access-Control-Allow-Origin" will fail to do so for "access-control-allow-origin"

Here the screenshot of the real example:

 smart_assertion_2021-12-07_18-59.png

Ok, so the header name is what has the case-sensitivity, not the header value, correct?

vorokai
Occasional Contributor

Yes, also added the screenshot to the previous post.

I would recommend a support ticket at this time: https://support.smartbear.com/readyapi/message/

vorokai
Occasional Contributor

Thanks for the reply @mattb.

Created support ticket.

JoostDG
Frequent Contributor

I believe this has been "fixed"...

I see in version history 3.20.1 (https://support.smartbear.com/readyapi/docs/general-info/version-history/bugs-fixed-in-ver-3-20-1.ht...) :

  • The Smart Assertion was case-sensitive when checking header names, so it could not find headers written using different cases. (RIA-18797)

 

While I applaud SmartBear for listening to this community and fixing issues raised by it's users, this fix did have a nasty side-effect for me... 

 

I updated my ReadyAPI version, ran my tests locally (on Windows, everything ran fine) and checked them into my repo. I noticed a lot of track changes, all with the same change: The Smart assertions metadata elements path got their upper casings changed to a lower casing:

JoostDG_0-1645802191520.png

 

Next day, when my tests ran in the pipeline (on a Linux agent with older readyAPI version 3.10.2) I got a ton of errors, all saying:

<h3><b>POST dossiers Failed</b></h3><pre>[Smart Assertion - HTTP201 and application/json] Smart Assertion failed:
Field 'Content-Type' does not equal (case-sensitive) 'application/json'; received: ''
Status: FAIL

 

I guess when I update the ReadyAPI version on the agent it will get solved, but that's not immediately available to me (have to request other team to do so)

So either I am stuck for a few days with a failing test pipeline...or I delete the smart assertions metada... I chose for the latter.

cancel
Showing results for 
Search instead for 
Did you mean: