java - Rest Assured - retry request if failed -
example test:
@test public void shouldgetrouteslist() { response response = given() .headers("requestid", 10) .headers("authorization", accesstoken) .contenttype(contenttype.json). expect() .statuscode(httpurlconnection.http_ok). when() .get("address"); string responsebody = response.getbody().asstring(); system.out.println(responsebody); logger.info("log message"); }
thing response service equals 500 error. it's because of application error , it's application fault add temp. workaround retry .get
if service returns 500. thinking if
or do-while
know it's not clever way. advice solution ?
in words - want retry whole test (or .get) if statuscode=!http_ok
Comments
Post a Comment