In our robot file, we will create a JSON variable, and utilize Python's built-in json loader to retrieve the data. Once we get the JSON loaded, we can use the "password" key to verify the expected value. I've added color coding to help show you what parts are matching.
*** Variables ***
${js string}= {
... "random": {
... "passwd_change_date": "2016-12-16T11:26:26",
... "passwd_fail_count": 0,
... "password": "123456789",
... "status": 0,
... "user_name": "test@test.com"
... }
... }
*** Test cases ***
TC
&{data}= Evaluate json.loads($js_string) json&{data}= Set variable &{data}[random]
Should be equal &{data}[password] 123456789
Source Reference:
How to evaluate JSON in Robot Framework
Reviewed by JJ The Engineer
on
5:41 PM
Rating:
you have written an excellent blog.. keep sharing your knowledge...
ReplyDeleteRobot Framework Test Automation Online Training
Robot Framework Test Automation Online Course
I'm dazzled, I should say. Only sometimes do I go over a blog that is both educative and intriguing, and doubtlessly, you have nailed it. The issue is an issue that insufficient people are talking cleverly about. Presently i'm upbeat I unearthed this during my chase for something with respect to this. best interiors
ReplyDeleteThis post is so useful and informative. Keep updating with more information.....
ReplyDeleteIELTS Certification
IELTS Coaching