????λ?????????? >> ??????????
????????????
???????????? ???????[ 2015/5/14 11:07:53 ] ???????????????
????????JSON??API??????????
?????????????????json????????API????????????????Σ?
????·queryParamters: ?????β???????????????URL??????????????????URL???棿?????????
????·pathParameters: ?????????????????????д??????????????????????URL?е??????//????
????·method?????????????д?????????????????????????get/post/delete/put??
????·resourceURL????????д??????????????????λ??
????·contentType???????????д??????????contentType??application/json????????д???????????д
????·headers???????????д???????????????????д?????????header??????????????????
????·body?? ??????????body???????????д??????????д????????JSON??????(?????????д???????????????)
????????????????????????????д??????????????????д?????????????????
????{
????"queryParameters":["userCode"?? "password" ]??
????"pathParameters":["ticketId"??"userId"]??
????"method":"POST"??
????"resourceURL":"/login"??
????"contentType":"application/x-www-form-urlencoded"??
????"headers":{"tokenId":"1234567432"??"Authorization":"890998776"} "body":"com.abcd.ddsf" }
???????????????API??JAVA??
????????????????????API??JAVA????????????????μ????飺 - ???????????BaseWebService - ????????????API?????????????????? - ??????????API????JSON?????·?? - ???BaseWebService???????
????public class LoginAPI extends BaseWebService { private final static String loginAPIDescriptionPath = "servicedescription/loginapi.json"; public LoginAPI(RequestData data) { super(loginAPIDescriptionPath?? data);
????}
????}
???????????????????
????????????????????excel????????????????????????????????img
??????????????????? RequestData.queryParameters(usercode)?? ???queryParameter?????key???usercode??value??????????????????????????
?????????????body????????excel??????У??е???????????RequestData.body??????????JSON?????????????JSON???????
?????????pathParameter???????RequestData.pathParameters(${key})??${key}??????pathParameter??????
???????????????????????????Test??resource???????棬?????????????????檔
????????????????
???????????????? - ????Dataprovider - ???????????
????@DataProvider(name="login_data") public Iterator getLoginData(Method m) throws InvocationTargetException?? Exception?? IOException {
????Map clazzMap = new HashMap();
????clazzMap.put("RequestData"?? RequestData.class); // build???????????????????????λ?? Iterator y= ExcelHelper.build("testcase/login/loginapitest.xls").loadExcelDataToIterator(clazzMap); return y;
????} @Test(dataProvider = "login_data") public void testLoginAPITes(RequestData data){
????LoginAPI api = new LoginAPI(data);
????api.execute(); //?????????? System.out.println(api.getResponse()); //????????????????200??302??401??500 ....... System.out.println(api.getResponse().getStatusCode()); //??????????? System.out.println(api.getResponse().getBody().toString()); //????????header???? System.out.println(api.getResponse().getHeaders()); //????????????????????? }
?????????????????????????????????????????????????????????????????????????????Щ????.
????API????????
????·API?? ??????apis??????
????·JSON?? ??????resource??servicedescription????
????·????????????? ??????resource??testcase???????£?????????????????????API?????
????·?????? ??????test??????
???????????????????????漰???????????????????SPASVOС??(021-61079698-8054)?????????????????????????
??????
??????????????????????????????????????????Ч?????????????????????????????????????????????????5????????????????????н?????????????????AR????????????ios???????????????Щ????????????????????AutoRunner??Selenium????????????????????????????????????Web????????????????Android???????????????Щ?????????????????????????????????????????????????????????????????????????????????????????????????????ζ????С??????????????????????????????????????????δ?????????????????????????????????????????????????????????Selenium???????????????????????Selenium?????????????Щ?????????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11????????
?????????App Bug???????????????????????Jmeter?????????QC??????APP????????????????app?????е????????jenkins+testng+ant+webdriver??????????????JMeter????HTTP???????Selenium 2.0 WebDriver ??????