41.Convert dynamic JSON Response to Java Object to extract values in Rest Assured
Vložit
- čas přidán 11. 09. 2024
- Hey Guys,
We have learned to deserialize JSON responses to Java Map and List in the last two video tutorials. But if we are not sure of the type of API response then deserializing may throw excepiton.
I have shown what kind of exceptions we may get and how can we avoid that using instanceof operator in Java.
GIT Repo - bitbucket.org/...
If you do not like my content please share your feedback so that I can improve myself.
If you like my content then please like, subscribe, and share.
Thanks
Amod
Hi Amod, I'm really thankful to you, you've cleared a lot of my doubts. I have just one request, if you could create tutorials on rest assured framework creation, with best practices, it'd be a great help.
Great to find you, you explained it very well with possible issues that we could encounter.
Excellent , thank you so much
This was asked in one of the interview . I was not able to answer this . But this video is useful . Thnxs for the video
Thanks a lot Amod. Great work!
Thanks so much it helped me a lot.
Hi Amod - Can you please make a series on Rest assured framework creation like reading /building request from excel, storing repsonse in files/excel, performing various validations on the response body, status etc. and then generating reports along with CI/CD integration. Thanks!
Sure
But try to give example in framework on huge response of api. Which is commonly use in the industry.
Nicely explained Amod. One quick question: Why did you have to convert response to Object. Since Object a superclass in Java, response is also a child of Object. So why is its required? Line no. 16 in your code
@RetargetCommon
Hi Amod.. Can you please tell.. How to compare text using regex in Matchers? This is not working: vr.body("bookingid", Matchers.matchesPattern(Pattern.compile("[a-z]")));
Hi sir,
Will u make video on api automation frameowrk in future?
Yes, soon
Please make a video on instanceof operator.
Noted.
Video looks good! can you please help me in reading values from the response which was store in object and list later?