web-api-testing

How to Send multiple request concurrently/Sequentially in postman with different set of values for each request?

只谈情不闲聊 提交于 2021-02-07 09:39:37
问题 For example, below is the JSON request data to "add a device" in the DB. For example, I want to add 10000 devices with different IMEI number and different phone number to the server for testing purpose. So, how to send the request at once. I'm ready to create 10000 devices data with different values manually. Now I can able to send one by one only.But how to send all the request at once? { "device_name":"34793812453274392", "imei_num":"36xxxxxxxxxxxx5", "phone_num":"8666606451", "device_city"

Building a nested JSONObject

大城市里の小女人 提交于 2020-06-17 07:24:06
问题 Below is the code I am using JSONObject requestParams = new JSONObject(); requestParams.put("something", "something value"); requestParams.put("another.child", "child value"); This is how the API needs to be posted { "something":"something value", "another": { "child": "child value" } } I get an error stating that "The another.child field is required." How do I go about posting this via restAssured? The other APIs that do not require posting with nesting work, so I'm assuming that's why it's

How to make post request with data in test-cafe?

老子叫甜甜 提交于 2020-06-15 06:44:24
问题 I am a beginner in api-testing, I'm using test-cafe and I have written test to make a GET request using RequestHook which is working fine, I was able to get the data but when I'm trying to make the POST request using the same RequestHook and I'm unable to send the data when making a request as it needs to be of type buffer. I can't convert the data of type JSON to buffer. While making a POST request. I want to know whether this is the correct way to make a POST request using RequestHook or do

Karate: Is there a http-request hook in karate, that gets called automatically after every API call, and whose behaviour I can modify?

自古美人都是妖i 提交于 2020-05-05 14:27:47
问题 I want a common implementation to write the: request-body, request-method & response-body to an output file for all the HTTP requests that I make in any of the karate feature files. I have read through the documentation, and the closest option that I found was the afterScenario hook. However this doesn't help me in cases where I want to make multiple API calls in the same scenario. I also tried using karate.prevRequest object by passing it to java function that I wrote. While this helps me

Karate: Is there a http-request hook in karate, that gets called automatically after every API call, and whose behaviour I can modify?

一曲冷凌霜 提交于 2020-05-05 14:27:08
问题 I want a common implementation to write the: request-body, request-method & response-body to an output file for all the HTTP requests that I make in any of the karate feature files. I have read through the documentation, and the closest option that I found was the afterScenario hook. However this doesn't help me in cases where I want to make multiple API calls in the same scenario. I also tried using karate.prevRequest object by passing it to java function that I wrote. While this helps me

Using REST Assured, how can I check if a field is present or not in an array of json objects type of response?

江枫思渺然 提交于 2020-02-24 11:08:08
问题 I need to validate that a response like the one below contains some fields. I am not interested in the fields value - just that the keys exist. For example I want to check that the key "id" is present in this type of response. How would I accomplish that? [ { "id":"1", "title":"Title", "details":"details", "benefit":"Welcome", "expirationTimestamp":1549995900, "notice":"some text", } ] If I do given() .spec(reqSpec). when() .get(). then() .body("$", hasKey("id")); I get an error like this:

Read Excel data .csv file sequentially in Jmeter

守給你的承諾、 提交于 2020-01-06 06:44:10
问题 I have a scenario to use data from each row for validation using a HTTP Request. have tried with the CSV config but it reads the first row only for the iteration. I have a single iteration and all my samplers are in a single thread group. The data from csv file is retrieved sequentially only when i give the iterations to a value say 3 (each iteration each row is taken) How to achieve on reading the csv file rows sequentially for single iteration ,where the thread group contains many HTTP

How can I solve error on then(). in Rest API

旧时模样 提交于 2019-12-31 06:58:27
问题 lease review below Code: package API_Testing; import io.restassured.RestAssured; import static io.restassured.RestAssured.given; public class FirstAPIClass { public static void main(String[] args) { RestAssured.baseURI="http://localhost:5100"; given(). header("tenantId","Augusta-PT"). when(). get("/WorkExperience"); then().assertThat().statusCode(200); } } Error on then statement: The method then() is undefined for the type FirstAPIClass Also, Can i write the code without then, If i dont have

Django rest framework: unit testing database issue

假装没事ソ 提交于 2019-12-25 09:47:53
问题 I am doing unit testing of the rest Apis. I am using django rest framework. Apis are saving data into and getting data from the database. Both of the operations are not working or if it is working i am not able to see that in the databases. Apis are also using django-fsm, because of which i need same data from the db for the other tests. Tests depends on previous tests due to django-fsm. There is always state changing with the api. But now i am not able to see any data in database during test

Got Timeout - Async callback was not invoked within the 5000ms timeout specified by jest.setTimeout

纵然是瞬间 提交于 2019-12-24 01:15:36
问题 I have problem with api-testing with jest What is the current behavior? Timeout - Async callback was not invoked within the 5000ms timeout specified by jest.setTimeout. at ../../../../Users/chhoeurng.sakona/AppData/Roaming/npm/node_modules/jest-cli/node_modules/jest-jasmine2/build/queue_runner.js:68:21 My current code it ('GET should return a status of 200 OK', function (done) { frisby .get('url-api') .expect('status', 200) .done(done); }); What is the current behavior? It should work