A、需要安裝的庫
1.RequestsLibrary,安裝命令:pip2 install requests 2.HttpLibrary,安裝命令:pip2 install robotframework-httplibrary 3.HttpLibrary.HTTP,這個庫是在HttpLibrary中,HTTP是HttpLibrary的一個class 4.json,安裝命令:pip2 install jsonpatch 5.Collections,這個庫是python自帶的,直接引入即可 |
B、RF需導入的庫
1. HttpLibrary 5.Collections--------------------------------------------------get from dictionary |
C、取json中的值
${json_data} set variable {"id": "18701236666","code": 200,"msg": "ok","data": {"tag_list": [{"game_id": "28","game_name": "天天酷跑"},{"game_id": "29","game_name": "斗地主"}]}} ${text01} Get Json Value ${json_data} /id
|
D、將json格式中[]轉化成python中dict格式
#將json[]中的值轉化成python dict格式
|
E、取值
#取值
|