How to use fiddler analog interface server

1, case description
Case: We used a weather forecast APP interface, the interface description as follows:
Interface Name: According to City weather query
interface address: http://v.juhe.cn/weather/index
return Format: json / xml
request method: get
request example: http://v.juhe.cn/weather/index?cityname=%E8%8B%8F%E5%B7%9E&key= KEY your application
request parameters:
name type Description required
citynameYstring city name, such as: "Suzhou", need to urlencode utf8
dtypeNstring return data formats: json or xml, the default json
formatNint next 7 day forecast (future) two ways to return format, 1 or 2, default 1
keyYstring your application to access secret key
return data example:
{
"ResultCode": "200",
"reason": "query success!",
"the Result": {
"SK": {/ current live Weather /
"the TEMP": "21", / current temperature /
"wind_direction": "West Wind "/ Current wind /
"wind_strength": "Level 2" / Current wind /
"humidity": ". 4%" / current humidity /
"Time": "14:25" / update /
},
"Today": {
"City": "Tianjin",
"date_y": "2014 Nian 03 Yue 21 Ri",
"Week": "Friday",
"temperature": "8 ° C for ~ 20 ° C for", / day temperature /
"weather Weather": "Partly haze" , / today's weather /
"weather_id": {/ Weather unique identification /
"fa": "00", / weather identifies 00: Clear /
"fb": "53" / Weather identify 53: haze if fa is not equal to fb, explained Weather is a combination of /
},
"wind": "Southwest wind breeze",
"dressing_index": "cold" / dressing index /
"dressing_advice":. "recommend a coat, coat it plus sweaters, sweater and other clothing" / dressing recommendation /
"uv_index": "Medium" / UV intensity /
"comfort_index": "", / comfort index /
"wash_index": "more appropriate" / car wash index /
"travel_index": "suitable" / Travel Index /
" exercise_index ":" more appropriate "/ Morning index /
" drying_index ":" "/ drying index /
},
" future ": [/ next few days Weather /
{
" temperature ":" 28 deg.] C ~ 36 deg.] C ",
" Weather ":" Partly cloudy ",
" weather_id ": {
" FA ":" 00 ",
" FB ":" 01 "
},
" Wind ":"南风3-4级",
"week": "星期一",
"date": "20140804"
},
{
"temperature": "28℃~36℃",
"weather": "晴转多云",
"weather_id": {
"fa": "00",
"fb": "01"
},
"wind": "东南风3-4级",
"week": "星期二",
"date": "20140805"
},
{
"temperature": "27℃~35℃",
"weather": "晴转多云",
"weather_id": {
"fa": "00",
"fb": "01"
},
"wind": "东南风3-4级",
"week": "星期三",
"date": "20140806"
},
{
"temperature": "27℃~34℃",
"weather": "多云",
"weather_id": {
"fa": "01",
"fb": "01"
},
"wind": "东南风3-4级",
"week": "星期四",
"date": "20140807"
},
{
"temperature": "27℃~33℃",
"weather": "多云",
"weather_id": {
"fa": "01",
"fb": "01"
},
"wind": "东北风4-5级",
"week": "星期五",
"date": "20140808"
},
{
"temperature": "26℃~33℃",
"weather": "多云",
"weather_id": {
"fa": "01",
"fb": "01"
},
"wind": "北风4-5级",
"week": "星期六",
"date": "20140809"
},
{
"temperature": "26℃~33℃",
"weather": "多云",
"weather_id": {
"fa": "01",
"fb": "01"the above cases, we analog interface requires the server to return information to the weather test APP, specific implementation steps are as follows:2, realization of}"ERROR_CODE": 0},]}"DATE": "20.14081 million""Week": "Sunday","Wind": "north wind 4-5",
},










(1) prepared in accordance with the "Return Data example" format provides a good test data, and save it as weather_response.json file.
(2) Open Fiddler, turn on the automatic response function, add and edit rules match, specifying the response file as shown below:
How to use fiddler analog interface server

(3) Enter in the browser address bar http://v.juhe.cn/weather/index?cityname= Beijing & key = KEY you are applying for conduct efficacy testing, results as shown below:

The above is how to use fiddler analog interface server, and you want to learn more knowledge of software testing, then you can continue to focus our section.
Want to know more courses in software testing, software testing adding excellent employment exchange group it, within the group will have a full-time teacher for you answering questions. In addition there will be occasional free live within the group lessons, taught by lecturers active duty. There are still active five days free trial to learn, got it, quickly join it. Remember to focus Oh! Http://heze.offcn.com

Guess you like

Origin blog.51cto.com/14669527/2471452