Questions tagged [rest-assured]
REST Assured is a Java library for writing simple and maintainable tests for REST services.
39
questions
1
vote
1
answer
65
views
How to share data between steps in Cucumber feature file?
I am designing automation scripts using the REST APIs, RestAssured with Cucumber BDD framework. I have multiple APIs where one API's response is used as a parameter in another API.
Here is my feature ...
0
votes
0
answers
32
views
Login flow automation of application which uses aws cognito to login the use into the app
I have an application where I need to automate the login flow using postman. The application UI accepts email and password but the thing is in the backend that application is using aws cognito to ...
0
votes
0
answers
7
views
Not able to capture/Extract id generated in response in Post method
I am facing this issue - capture/print the id generated in response
last 2 line are the issue, the moment i take out last 2 line,test get passed
public void emp()
{
RestAssured.baseURI= "...
-1
votes
1
answer
24
views
I am manually putting ID generated via POST method in PUT,GET method, How to Auomate it
ISSUE- Using post method, ID get generated in response(id=ff80818188956aa6018899e27b76038b), now I don't want to put this id generated in PUT,DELETE,GET, manually(as I am doing below)
Can you please ...
0
votes
0
answers
253
views
How to verify the Json response field data type in rest assured test
How can we verify the Json data type of mentioned fields such as "price", "ck", "name", "enabled" and "tags" in rest assured test.
{
"odd":...
0
votes
2
answers
2k
views
How can I store a value as global variable from an API response and pass it to another API as parameter in Cucumber feature file using REST assured
I am designing automation scripts using the Cucumber BDD framework for REST APIs using RestAssured. I have one API which generates the "Token" and then there is another API for order ...
-2
votes
2
answers
487
views
Should i learn SOAP API or Rest Assured API Testing? [closed]
I am new to API testing world.
Should i learn Rest Assured API testing using maven and eclipse or should i learn all things on Soap UI or Postman tool?
Which tool is more in demand in IT industry and ...
1
vote
1
answer
3k
views
How to send nested JSON in cucumber as request
I'm trying to send nested JSON through Cucumber data table. I have the following scenario, I have tried Scenario Outline too but it didn't resolve the issue.
Scenario: provider edits new ...
0
votes
1
answer
269
views
java.lang.NullPointerException,at ✽.Given product is set with the following fields(src/test/resources/features/wizard/wizardNewProduct.feature:
Pls, I need help, I'm getting a null pointer exception, When I send a request, I'm catching values in Cucumber through the List<Map<String, String>>.
I'm testing API with Rest Assured and ...
1
vote
1
answer
436
views
AllureRestAssured , how to ignore logging headers
I am using rest-assured and allureRestAssured for testing api
given().header("Content-Type", "application/json")
.header("key", key()).filter(new ...
2
votes
2
answers
7k
views
Handling cases where a JSON Key exists or not
I'm using rest-assured to test an API. I want to handle a scenario where a key might not exist
Given:
{
"shop":{
"shopId":1892929,
"name":"bobs shop"...
1
vote
3
answers
684
views
Avoiding a NPE when checking JSON response using JsonPath and Rest Assured
Given the following JSON:
{
"priceOne": 1034,
"priceTwo": null,
"priceThree": 7282,
}
...and the following Rest Assured method to get the priceTwo value and ...
-1
votes
1
answer
699
views
Rest assured vs Http client for Api testing? [closed]
Which approach or should I say framework is better and which are let say 3 facts you should consider when making final decision?
7
votes
4
answers
43k
views
Free sites for testing POST REST API calls?
My previous company was testing only GET calls. Now I need to practice with other type of calls (POST, PUT, DELETE).
I can not find any site that is free for POST API calls, and that it have up to ...
0
votes
1
answer
5k
views
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)?
{
"userId": "dummy1",
"userRole": "s",
"integrationId": "null",
"integrationType": "dummy",
"externalUserId": &...
1
vote
1
answer
199
views
Getting an error while trying to run a script using Rest-Assured library
Getting an error while trying to run a script using Rest-Assured library along with Selenium. Anyone has encountered this kind of error while scripting with Rest-Assured. My code is scattered across ...
0
votes
0
answers
29
views
I have automated Soap request via Rest Assured code, but its written that Rest assured API can only be used for rest service [duplicate]
Here is my code
public class xmlreq extends TestBase {
@Test
public void buildRequest()
{
logger.info("starting");
RestAssured.baseURI="http://webservices.oorsprong.org/...
0
votes
1
answer
1k
views
Shows "[Utils] [ERROR] [Error] java.lang.NullPointerException" for data driven(excel File) API Automation test(Rest Assured)
It throws a java.lang.NullPointerException, but why it shows that, I could not find.
Here is my code.
ExcelUtil
package Utils;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
...
0
votes
1
answer
624
views
aspectjweaver must be a valid version in POM.xml [closed]
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
...
0
votes
1
answer
2k
views
Rest-assured - Schema to use cannot be null
Using the code below, I'm getting the following error:
My code:
@Test
public void get_user_API_Schema_Test() {
RestAssured.baseURI = "https://gorest.co.in";
given()....
1
vote
4
answers
16k
views
TestNG- No tests found. Nothing was run
UTF-8
io.rest-assured
rest-assured
4.1.2
test
org.testng
testng
6.14.3
...
1
vote
1
answer
637
views
Getting error - .........either make it static or add a no-args constructor to your class
I am writing test scripts with Rest-Assured java. I have two classes ApiMethods and AppMethods belonging to one package and another test package called apiTests using the methods created in the ...
0
votes
1
answer
3k
views
Extract multiple JsonPath values from returned Response using Rest Assured
I need to obtain two values from JSON response data returned from a Rest Assured modelled request:
Request
public void getCustomerStatuses() {
Response response =
given().header(...
1
vote
2
answers
4k
views
How to verify the JSON structure (only Key , Not value) in Response using Rest Assured framework (Java)
“Output”: [
{
"id_": “123”
"first_name": “Testing”,
"last_name": “Validation”,
"state": “VA”,
“yearofbirth”: 1983,
"currentcompany”: null
}...
1
vote
1
answer
712
views
RestAssured: Url Constrcution with query param where param value is not String
Is there a way to construct Url with query parameters where the value of the query param is not string. For String values of query parameter there are APIs in RestAssured or apache httpClient but I ...
-2
votes
1
answer
8k
views
How to extract a value from a JSON response with Java and Rest-Assured
I'm getting the response below. I need to assert the value of "Type". How can I get the value? I'm using Java and rest-assured
The response:
"Product1": {
"Productive1": {
"applause": {
...
2
votes
2
answers
1k
views
REST Assured API | Why we use equalTo() while asserting body part of response?
When we assert our body part, we use the method equalTo() but while asserting for Header, we are just providing ("Key","value") pair only.
Why can't we use just-
body("scope&...
0
votes
1
answer
5k
views
Rest-assured. Is it possible to extract JSONObject/JSONArray from response json?
I'm Using RestAssured,
and i'm getting the response like this-
{
"Data": {
"Sub": {
"SubDetails": [
{
"OrgId": 5,
...
0
votes
1
answer
503
views
Cucumber with and without Rest - Assured. What are the advantages?
Currently my team uses Cucumber as a testing framework.
We need to start testing REST web services. I understood that REST-Assured is one of the leading tools for that.
Can these tools be used in ...
2
votes
2
answers
4k
views
Rest Assured Vs. Apache HttpClient performance
I am checking Rest Assured now, and want to understand its performance.
So, I created 2 unit tests:
public static final String C_URL = "http://ergast.com/api/f1/2017/circuits.json";
@Test
public ...
1
vote
1
answer
2k
views
How to remove keys from rest-assured ValidatableResponse and assert response with constant json string
In rest-assured test cases I am getting mentioned 'ValidatableResponse response' where I want to remove keys such as "updated_at", "deleted_at", "created_at" and "notice" and assert this object with ...
0
votes
1
answer
249
views
Is it a good practice to compare responses with benchmark responses in API Test Automation?
Is it is good practice while writing automated tests for APIs to compare the complete response of the requests with a benchmark response instead of writing specific tests to verify the required values ...
0
votes
1
answer
1k
views
Rest assured API to get a element from Json response
I'm using restassured.path.json.JsonPath extractor
From the below response I would like to extract the customerProductIdentifier where highLevelProduct is HSI,
{
"recordsChoice": [
{
...
0
votes
1
answer
79
views
Session is outdated or not initialized while sending Request
When I send POST request to the server for SignUp I receive an error that session is outdated or not initialized. How could it be solved?
// create request
@BeforeClass
private void ...
4
votes
2
answers
5k
views
What are design patterns for REST Assured?
For Selenium usually Page Object Model is used.
What are good design patterns for REST Assured to organize structure, files?
0
votes
1
answer
335
views
NullPointerException in RequestSpecification
Getting Null pointer exception whenever running, unable to resolve.
Below is my code
public static RequestSpecification setFormParam(String formParam, RequestSpecification reqSpec)
{
...
0
votes
3
answers
92
views
How to handle response varying from developer tool to code debugging in chrome?
I'm using RESTassured with Java. Getting response in compressed from UTF16 format. Response varies from developer tool to code debugging in Chrome/Firefox, here variation means some character got ...
2
votes
4
answers
1k
views
What is the best approach to the REST APIs automation?
I have been working on REST API test automation in JAVA and have many approaches in my mind but not able to decide which one is better. Here are few approaches that I can think of-
Very Simple and ...
0
votes
1
answer
2k
views
Rest Assured | Why getting repeated errors when trying to automate apis using rest assured?
I have just set up rest assured framework and implemented it as a maven project. My pom.xml has the below mentioned dependencies
<dependencies>
<!-- https://mvnrepository.com/artifact/io....