All Questions
Tagged with web-api-testing java
98 questions
0
votes
1
answer
45
views
Authorization token is not working in Rest Assured
package com.automation.tests;
import static io.restassured.RestAssured.*;
import org.json.JSONObject;
import io.restassured.response.Response;
import io.restassured.specification.RequestSpecification;...
0
votes
2
answers
103
views
How to replace repetitive pattern in a string in Java?
I have intelliJ running with Java/REST API and having trouble removing and replacing string in a certain format.
Response string :
{"isSuccess":[{"frequency":}]}]}}{"...
0
votes
0
answers
95
views
Cucumber: Feature file is unable to find step definitions when they are in separate modules
I am unable to map the feature file to the step definition one which is in different module.
The project is split between two Java modules, in the firts one are the feature files and the runner and in ...
1
vote
0
answers
254
views
Unable to access the karate-config.js inside my handler.feature file
I was trying to access the karate-config.js file inside the features file. Created a file name karate-config.js
function fn(){
var config = {
name:"test",
baseUrl: "http://example.com&...
0
votes
0
answers
295
views
REST Assured Test Failing due to "NoSuchMethodError"
I am trying to generate Auth0 Access Token by sending a POST request in Rest-Assured TestNG framework. The Content Type that I need to pass in request body is "application/x-www-form-urlencoded&...
0
votes
1
answer
260
views
Run Jmeter Test with Jmeter Dependency
I have a bunch of Jmeter files (.jmx) which have a lot of tests inside them. I want to run these test without the dependency of jmeter. Is there a way to run jmx files directly in Java without having ...
1
vote
0
answers
25
views
Not able to execute Karate Feature file on windows 10 [duplicate]
Am unable to execute Karate Feature file. What am missing?
Am using Eclipse IDE and trying to execute the feature file as "Run As" >> "Cucumber Feature"
I have followed below ...
3
votes
1
answer
485
views
How to use query parameter with different combination in rest assured in Java?
I have 6 query parameters. All of them are optional.
How should I use them with all combinations?
I tried the following:
do {
Response searchbyfield = given()
.headers("Cookie", ...
0
votes
1
answer
668
views
Unable to pass raw JSON request body with response error "The browser (or proxy) sent a request that this server could not understand"
I am trying to make a GET request to the URI which has header Content-Type=application/json and has a request body which is a raw JSON type.
Below is the code I am using with RestAssured API but it ...
0
votes
1
answer
546
views
Getting 407 Authorization error while executing RestAssured code after providing custom proxy details
I'm new to API testing using Rest Assured.
As I'm working behind the proxy, I have used all the proxy details in the code. Below is the code I'm trying to execute. Getting 407 error.
...
1
vote
1
answer
2k
views
How to Call the Karate Scenario from the Java Programatically?
I have Karate scenario defined as below
Feature: Random Users
Background:
* url 'https://askuser.me'
@get-user
Scenario: Get Random User data
Given path 'api'
When method get
...
0
votes
1
answer
2k
views
How can I turn ON "Automatically follow redirect" in Rest Assured/Java
I'm stuck on this issue, please help...
So, Post request working fine on Postman, but in Rest Assured I am getting 307 Temporary Redirect status code. I find that this issue related to redirects. ...
0
votes
0
answers
162
views
How to apply sorting on a time stamp field in Rest Assured Java
I've an API response which is sorted via the field provided in the payload. The API response body has a lot of parameters out of which the field on which it is sorted is a date-time field. How can I ...
0
votes
0
answers
261
views
How to get the response of an intermediate API call?
I am currently trying developing some API tests using rest-assured. More specifically, I am trying to test Stripe's payment gateway (3DS). The way it works is that I subscribe a user using our API ...
2
votes
1
answer
473
views
Convert class to parameters map in REST Assured
I have the following class:
data class Person(
val name: String,
val surname: String,
val age: Int
}
and I want to do this:
val person = Person("John", "Locke", 66)
...