Contributions
Re: [Bug?] Autogenerated json assert on content does not work if json element has a . in the name
Oh - I would not expect a patch for any previous version, with the workaround I found we are fine - I just meant to say that I am not in a position to check if a bug also exists in a later version of the product, I just don't have the time. The link you provided seems to not quite apply? The closest category for ReadyAPI would seem to be 'technical inquiry' which it is not - its purely a bug report? Or is that the right category? In the previous version of the boardsthere was a specific forum where bugs could be reported, I've done so a few times - is it an idea to set one up again?9 years agoPlace ReadyAPI QuestionsReadyAPI Questions1.8KViews0likes1CommentRe: How do I assert one of the objects in an array meets a condition in SoapUI by using JSONPath
I have only used the JsonPath Existence match to check if a particular node appears, like say: JSONPathExists:$.data[0].title Im not sure it can be used for more complex JSONPath? It would be great (in general) if smartbear could create some detailed, practical examples !9 years agoPlace ReadyAPI QuestionsReadyAPI Questions7.9KViews0likes0CommentsRe: How do I assert one of the objects in an array meets a condition in SoapUI by using JSONPath
andrew_net wrote: By the way, to get around the problem with multiple items, you can use "JSONPath Count" or "JSONPath Existence Match" instead of "JSONPath Match" as you see fit to assert the "number of occurences" or "existence". So the JSONPath assertions in SoapUI does meet my needs. Hi - thanks for the suggestion - you are of course correct for cases where the expected count is known beforehand.The JSONPath Countassert didn'twork for us in cases where it can be '1 or more' (ie - when it is unpredictable how many occurrences there might be). I would love an assert like xpath where you can do count( //blah ) >= x. But then we should have stuck with XML I guess :) Regards, Ton9 years agoPlace ReadyAPI QuestionsReadyAPI Questions7.9KViews0likes2CommentsRe: [Bug?] Autogenerated json assert on content does not work if json element has a . in the name
Hi Tanya, While I understand your question and it is certainly not unreasonable, I am afraid I am not able to do that - we cannot just upgrade readyAPI from a known stable version in our work environment as we need to use it daily. I respectfully suggest forwarding this bug to yourmaintenance department so they can assess and try to reproduce it? Or is there a more appropriate way for me to submit a bug report than this forum? If so - my apologies and could you let me know what that is? :) Regards, Ton9 years agoPlace ReadyAPI QuestionsReadyAPI Questions1.8KViews0likes3CommentsRe: Dynamic global properties
Ah, got it now - something like an access token that changes every x seconds... I'm afraid that is beyond what I have tried so far, sorry. However, it would seem that you should be able to code that in a similar way? I used several lines in the epoch parameter for example. Just because I cant leave well enough alone - this might be another solution, albeit rather hacky and probably fraught with risks... but if you had an external file that held the current value to use, you might be able to use a system command to echo it and use the input? Just a quick example that would insert the contents of tokenfile on my (Linux) system... ${="cattokenfile".execute().text} Edit - on second reading, that might be exactly what you need if you had an external script that would generate the value in stdout? (As you can tell - I am less of a developer than a tester ... )9 years agoPlace ReadyAPI QuestionsReadyAPI Questions1.4KViews0likes2Comments[Bug?] Autogenerated json assert on content does not work if json element has a . in the name
I think this is a fairly straightforward bug, when I right click on some json content (sample below with data redacted for privacy) and select 'assert on content' it auto generates a jsonpath assert but immediately throws an 'invalid jsonpath' error. It seems the . in the json element is throwing things off. Here is the json child element sample (the structure is similar to data/parent/metadata/place.ctry) "place.ctry": "Canada" The assert being generated is: $.data[0].parent.metadata.place.ctry But that implies .ctry is a sub element to place, not one element. Regards, Ton Vlaming Ps. This is from readyApi 1.4.19 years agoPlace ReadyAPI QuestionsReadyAPI Questions1.9KViews0likes6CommentsRe: Dynamic global properties
I hope I understand your problem correctly and you want to essentially have a global property that changes each time you use it? Using a timestamp for example, this is what I have for a property 'epoch' ${=Calendar c = Calendar.getInstance(); c.add(Calendar.DATE,0); c.getTimeInMillis()} When I use ${#Project#epoch} as input in a call, each time I invoke that call it will have a new value. Here is another example (not a property but set on the input for a particular api call) where I use a timestamp in a call with an additional identifier (the test name with spaces removed) ${=import java.text.SimpleDateFormat ; "MYPREFEX-" + context.getTestCase().getLabel().replaceAll("\\s+","") + "-" + new SimpleDateFormat("YYYYMMdd-HHmmssSSS").format(new Date()) } Hopefully that is helpful to you.9 years agoPlace ReadyAPI QuestionsReadyAPI Questions1.4KViews0likes4CommentsRe: How do I assert one of the objects in an array meets a condition in SoapUI by using JSONPath
That is a problem we have struggled with as well - I think this solution will work too, if you use expected result '100' for the following jsonpath, it should evaluate true if code 100 is present in thesample json. Basically it is asking to return the code value for any errors element where the .code subelement equals 100... Of course this will run into problems if there can be multiple errors.code items in the json, but it has proved very useful in our tests. $..errors[?(@.code==100)].code Json used {"errors": [{ "code": "100", "message": "Message for 100" }, { "code": "200", "message": "Message for 200" } ]}9 years agoPlace ReadyAPI QuestionsReadyAPI Questions8KViews1like5CommentsRe: [Bug?] Autogenerated json assert on content does not work if json element has a . in the name
Forgot to mention that the simple solution would be to change it to: $.data[0].parent.metadata.[place.ctry] Did that manually and it appears to work fine.9 years agoPlace ReadyAPI QuestionsReadyAPI Questions1.9KViews0likes0CommentsCan't create Xpath asserts from Json content
In soapUI 4.6 (and before) we could easily create xpath asserts even for Json result sets. Now, for the same result sets, when I add an xpath assertion and click on the little 'select node'button to select an element, it always gives "Unexpected element: CDATA". I can still make it work, just need to 'manually' put in the Xpath assert. It seems to be specifically unable to show the tree anymore. I'm assuming something basic is failing when converting the json to xpath that worked in older soapUI versions.10 years agoPlace ReadyAPI QuestionsReadyAPI Questions626Views0likes0Comments