10 votes

Free sites for testing POST REST API calls?

As this answer on Stackoverflow states. https://httpbin.org/ allows you to echo back your request, to see that it does what you expect. this is the list of services It echoes the data used in your ...
JoSSte's user avatar
  • 207
5 votes
Accepted

Free sites for testing POST REST API calls?

https://www.postman.com/explore it have many collections and examples, you can create a account and fork it and use. or create your own mock server here and learn: https://app.mocklab.io/
PDHide's user avatar
  • 11.1k
5 votes
Accepted

What are design patterns for REST Assured?

Here's a number of design patterns you can use for testing REST services (with REST-assured, but not necessarily*): Service Object pattern. Just like Page Object encapsulates HTML page, Service ...
dzieciou's user avatar
  • 10.5k
4 votes

What is the best approach to the REST APIs automation?

A few thoughts: Automation code should be reviewed, so I don't think that's a con Not sure why failing test cases would keep your build from compiling. Even if the test code lives in the same repo ...
ernie's user avatar
  • 1,040
3 votes

Handling cases where a JSON Key exists or not

You just get Response object from your call and do: public class Test { public static void main(String[] args) { Response response = RestAssured .get("https://mocki....
Alexey R.'s user avatar
  • 11.6k
3 votes

Free sites for testing POST REST API calls?

Here is a good website for that: https://restful-api.dev/ You can send POST, PUT, DELETE, etc. They actually store the data which you create via POST. So, if you create an object using POST, you can ...
Antonio's user avatar
  • 31
3 votes

Free sites for testing POST REST API calls?

https://jsonplaceholder.typicode.com/ {JSON} Free fake API for testing and prototyping. Powered by JSON Server + LowDB As of Dec 2020, serving ~1.8 billion requests each month.
Michael Durrant's user avatar
3 votes

What is the best approach to the REST APIs automation?

As with any project, it depends :). That said, (1) and (2) require close coordination with development team. Depending on the team structure it may be a good thing or a bad thing :). I also suspect ...
Dakshinamurthy Karra's user avatar
3 votes
Accepted

TestNG- No tests found. Nothing was run

make sure you are importing org.testng.annotations.Test and not org.junit.Test
velocity's user avatar
  • 146
3 votes

Should i learn SOAP API or Rest Assured API Testing?

Don't focus too much on tooling. Tools will go out of fashion. Perhaps not this year, not in 2 years, but definitely a few times during your career life (provided you are not at the end of it, but ...
pavelsaman's user avatar
  • 4,548
2 votes

Getting error - .........either make it static or add a no-args constructor to your class

Why you are initializing the AppMethods ApiMethods inside the testclass constrcutor this is not right way testng works only with the class which has constructor with no arguments You can use @...
Mohamed Sulaimaan Sheriff's user avatar
2 votes

NullPointerException in RequestSpecification

Now take a look at setFormParam() method: System.out.println(reqSpec);// reqSpec Always getting null value reqSpec.formParam(keyValue[0], keyValue[1]); and then at postCandidateResponse() that calls ...
dzieciou's user avatar
  • 10.5k
2 votes

How to handle response varying from developer tool to code debugging in chrome?

What you show is actually a response body. Headers are represented in "Headers" tab in Dev Tools like this: Brief look up of what you provided shows that it's UTF-16 encoded string: For example: 1 -...
Alexey R.'s user avatar
  • 11.6k
2 votes

Rest assured vs Http client for Api testing?

Which approach or should I say framework is better? I don't think you can compare them just like that when you don't mention any context, any goals you might have, what you want to achieve with the ...
pavelsaman's user avatar
  • 4,548
2 votes
Accepted

Rest-assured - Schema to use cannot be null

The file path should be relative to class path , try statusCode(200).and().body(matchesJsonSchemaInClasspath("\\test\\java\\com\\rest\\api\\schema\\getuserschema.json")); or statusCode(200)....
PDHide's user avatar
  • 11.1k
2 votes

Handling cases where a JSON Key exists or not

Example json: { "priceOne": 1034, "priceTwo": {"new":2}, "priceThree": 7282 } Checking the value of "new" Response response =...
PDHide's user avatar
  • 11.1k
2 votes

AllureRestAssured , how to ignore logging headers

You can blacklist the headers you don't want to see in the report: given().config(config().logConfig(logConfig().blacklistHeader("Accept"))). .. Documentation here.
João Farias's user avatar
  • 10.9k
1 vote
Accepted

Avoiding a NPE when checking JSON response using JsonPath and Rest Assured

String response =RestAssured.get("https://praveendvd.free.beeceptor.com/test"). then().extract().response().asString(); JSONObject jsonObj = new JSONObject(...
PDHide's user avatar
  • 11.1k
1 vote
Accepted

How to verify if any key is having null value from Json response in rest assured(Just have to verify if in response null value is there)?

You can use Hamcrest matchers to verify that: package click.webelement.api.restassured; import io.restassured.RestAssured; import java.net.MalformedURLException; import java.net.URL; import static ...
Alexey R.'s user avatar
  • 11.6k
1 vote

Getting an error while trying to run a script using Rest-Assured library

Looking at that stracktrace, the regular expression used for the matching is recursing infinitely causing a stackoverflow exception. Your search criteria is likely being translated into a regex ...
anichols's user avatar
1 vote
Accepted

Shows "[Utils] [ERROR] [Error] java.lang.NullPointerException" for data driven(excel File) API Automation test(Rest Assured)

Check if you have correct sheet name. As you can see in stacktrace, error happens in ExcelUtil line 27. Debug/Print the sheet name to see if the value is correct.
Millie Anne Volante's user avatar
1 vote

Rest Assured | Why getting repeated errors when trying to automate apis using rest assured?

The Problem is with scope of the Rest Assured dependency in the pom.xml file If your running your Rest Assured test from src/main/java the scope should be compile and your dependency will be as shown ...
Mohamed Sulaimaan Sheriff's user avatar
1 vote
Accepted

Extract multiple JsonPath values from returned Response using Rest Assured

JsonPath that is used in RestAssured uses the different syntax. Your path would look like cust.findAll{i -> i.name == 'STATUS_ID' || i.name == 'RENEWAL_ID'}.id. Here is the example code: package ...
Alexey R.'s user avatar
  • 11.6k
1 vote
Accepted

How to verify the JSON structure (only Key , Not value) in Response using Rest Assured framework (Java)

Here is the example that addresses your particular problem: package click.webelement.api.restassured; import io.restassured.path.json.JsonPath; import java.util.HashMap; import java.util.List; ...
Alexey R.'s user avatar
  • 11.6k
1 vote

RestAssured: Url Constrcution with query param where param value is not String

I am not sure what you are trying to do, your code fails because public String urlBuilder(String url, Map<String, String> queryParam) In the parameter definition, you type casts it as a Map ...
PDHide's user avatar
  • 11.1k
1 vote

How to extract a value from a JSON response with Java and Rest-Assured

What you are showing is called a JSON object. Unless you're in JavaScript (that can natively parse JSON data) you can use a jsonpath language that is very similar to xpath (serves for similar purpose)....
Alexey R.'s user avatar
  • 11.6k
1 vote
Accepted

REST Assured API | Why we use equalTo() while asserting body part of response?

Answering your particular question, I'd like to spotlight that there are several ways to assert headers. And ("Key","value") is one of those ways. You can also find the methods which allow you to ...
Alexey R.'s user avatar
  • 11.6k
1 vote

Rest-assured. Is it possible to extract JSONObject/JSONArray from response json?

Why is this not an option? JsonPath resJson= new JsonPath(response); JsonPath referrenceJson= new JsonPath(jsonTOCompare); Assert.assertEquals(resJson.get("fields"), referrenceJson.get("fields"));
PDHide's user avatar
  • 11.1k
1 vote
Accepted

Cucumber with and without Rest - Assured. What are the advantages?

1 - Sure. Cucumber is a test runner. The goal of this kind of tool is only to execute a suite with certain structure is a certain way. Cucumber manages the execution of certain methods according to ...
João Farias's user avatar
  • 10.9k
1 vote
Accepted

Rest Assured Vs. Apache HttpClient performance

Is it a fair test? Not really. Performance tests usually involve warm-up phase as anonygoose suggested in his/her answer. For instance, in case of HTTP clients this is to let them start thread and ...
dzieciou's user avatar
  • 10.5k

Only top scored, non community-wiki answers of a minimum length are eligible