【发布时间】:2014-03-05 10:04:18
【问题描述】:
场景:- 我使用 API 执行负载测试
HTTP 请求 1
我使用http://cabhound.com:1000/v2/driver/login 登录并收到以下回复
{"statusCode":200,"statusMessage":"Success","errorMessage":"","responseData":{"id":0,"userName":"PQeurentraps5S@tarento.com","firstName":"Partner","lastName":"Tarento","phoneNumber":"2641148625","email":"tamvrentrapnsr@tarento.com","password":"","addressOne":"","addressTwo":"","city":"","state":"","zipCode":"","loginCount":156,"welcome":"","smsOptIn":false,"promoCode":"","userNotification":"","errorMessage":"","message":"","sessionId":"6063tnerLt3013951671120oDse18492930#2","osType":"","osVersion":"","deviceType":"","deviceId":"","latitude":"","longitude":"","timeZone":"","appVersion":"","company":"Tarento","licenceNumber":"","vehicleType":"","vehicleFeature":null,"subscriptionType":"unlimited","driverWorkingCity":"Bangalore","vehicleNumber":"","locationUpdateTime":20,"rate":0,"reliable":0,"distance":0.0,"eta":0,"latitudeLongitude":"","status":"ON","payment":{"paymentType":"","cardNumber":"","cvnNumber":"","expDate":""},"vehicleTypeList":["Sedan","Limousine","SUV/Wagon","Minivan","Other"],"vehicleFeatureList":["Navigation System","Eco Friendly","Handicap accessible","Accepts credit cards"],"driverId":582,"currentLocation":null,"companyCode":"tarento","acceptanceRate":0,"like":0,"profileIndicator":0,"payWithCabHound":false,"smsSupport":false,"paymentInfo":false,"geoInfo":"","active":true}}
请查看上面响应中的会话 id,我想在下一个 http 请求数据中使用它
HTTP 请求 2
http://cabhound.com:1000/v2/driver/dutyStatus
下面是我需要发布的数据,这里我想使用 HTTP Request 1 的 session id
{"status":"ON","sessionId":"1311tnerLt9013956793297oDse462783#2","longitude":"77.686700","userName":"erpkrentrapJps@tarento.com","latitude":"12.934487"}
如何将 HTTP Request 1(响应)的 session id 传递给 HTTP Request 2 Post Data
帮助我解决我遇到的问题
【问题讨论】:
标签: json automation jmeter performance-testing jmeter-plugins