Questions tagged [json]

JSON (JavaScript Object Notation) is a 100% textual data interchange format originally inspired by JavaScript objects. It is widely used in RESTful web services. Parsers for JSON exist in nearly all languages, and libraries also exist which can deserialize JSON to native objects or serialize native objects to JSON.

Filter by
Sorted by
Tagged with
6 votes
6 answers
29k views

Suggest me the best way to automate REST web services with JSON using Java

I was testing web services manually using Postman or REST client. I want to automate testing here. I use REST with JSON format. Questions: How to use target URL ? How to pass header values? How to ...
Jagadeesh's user avatar
5 votes
1 answer
10k views

How to Use Http Request/JSON extractor(using Jmeter Variable) in Jmeter with Response assertion(using Jmeter Variable)

How to Use Http request/JSON extractor(using Jmeter Variable) in Jmeter with Response assertion(using Jmeter Variable). better to provide with Example?
lak's user avatar
  • 567
4 votes
2 answers
7k views

How to send API request json body in cucumber

Can anyone help me to send json request in one line ?? Example { "benefitPlanIDs": [ { "benefitPlanID": "011748abc", "benefitPlanPlatform": "abc" } ], "clientId": "abc", "...
Babita's user avatar
  • 51
3 votes
1 answer
12k views

What is the simplest way to rewrite Postman requests to C#

I have made lots of made Requests in JSON in Postman. Now I am thinking about re-write all the Postman-tests into C#. There are many different Nuget packages that could be used. I have googled a lots, ...
XsiSec's user avatar
  • 242
3 votes
1 answer
1k views

How to verify particular values in JSON response - Postman

The response body looks like this. [ { "id": 1, "wardName": "Unit1" }, { "id": 2, "wardName": "Unit2&...
kasuni gunasekera's user avatar
3 votes
1 answer
705 views

How to count max character text for JSON api test

I have a JSON free text field that allows maximum 1000 characters. I want to check whether user is able to send paragraphs, so when I parse the text to string using online tools some extra characters ...
sathishS's user avatar
3 votes
3 answers
3k views

How do I parse more than one parameters from the response in Jmeter?

Currently, I am using JSON Path Extractor as my POST PROCESSOR to parse parameters from response body. Suppose say I have to parse two parameters from response 'AuthenticationToken' as well as 'userId'...
Channabasava. A's user avatar
2 votes
2 answers
10k 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"...
Steerpike's user avatar
  • 393
2 votes
1 answer
2k views

Should I write unit tests when the json schema is validated by a 3rd party library

I have some json data and I would like to validate the data against a defined json schema. I'm using the ajv library for the validation. On the json schema, there are constraint you can specify like ...
pdiddy's user avatar
  • 123
2 votes
1 answer
3k views

Using Jmeter How to Match values in Json response with JDBC response?

How to Match values in JSON response with JDBC response? just want to check that correct values passing in JSON response and need to verify that those values are matched with JDBC response (fetching ...
lak's user avatar
  • 567
2 votes
2 answers
464 views

Help me please, how to upload file. File-input appended on click, but on click it opens OS native window

Can not upload a file. DOM elements: <button type="button" id="button-upload" data-loading-text="Loading..." class="btn btn-primary"><i class="fa fa-upload"></i> Upload</button&...
Kuznetc's user avatar
  • 21
2 votes
1 answer
2k views

How do I save JMeter variables created at runtime?

I'm using JMeter 3.1 to run a http-endpoint test & I need to extract a very small portion of the return JSON I receive. I'm using the JSON Extractor postprocessor element & JSONPath ...
Rob Truxal's user avatar
2 votes
1 answer
2k views

Jmeter - Json Extractor removing white space causes test to fail

Apologies if this is something fundamental which I should already know. I've got a test set up in jmeter using a Json Extractor. The data which it is extracting is in the format: "data item 1", "data ...
Tufty's user avatar
  • 423
2 votes
0 answers
121 views

Cookie Banner is not shown [403 error]

I need help with the following scenario: In a website, OneTrust cookies are implemented. The cookies are from an external company. The cookie solution is implemented by including a couple of ...
eshu's user avatar
  • 25
1 vote
2 answers
4k views

JMeter - JSON parse error: Unexpected character

I am trying to add dynamic Post response on one rest API URL(http:IP:9000/page) with data as a JSON request in file format, So to add that file in post body I use the command: {__$FileToString(C:\...
sneh mishra's user avatar
1 vote
2 answers
2k views

How to perform HTTP PUT Request by reading values from CSV in JMeter?

I have a question how can I set up HTTP Request Sampler for HTTP PUT method in JMeter so it can read data from CSV file using CSV Data Set Config? In my scenario I'm using **Concurrency Thread Group** ...
NikolaS's user avatar
  • 143
1 vote
3 answers
958 views

How to Automate web services using JMETER?

How to Automate web services using JMETER? I need to check URL links are working and image are loading properly and with the response code given. see more details in below example, i just want to ...
lak's user avatar
  • 567
1 vote
2 answers
161 views

How do I capture some portion of logs from a log file?

Basically my requirement/need is to capture some snippet of the logs from a log file (or in other words parse log file)and then check if that portion is a valid JSON also. Any pointers?
R11G's user avatar
  • 173
1 vote
2 answers
495 views

jMeter - Paramater from JSR223 PreProcesser is not replacing the parameter in JSON request body in the request

mobileNubmer is being generated in JSR223 PreProcessor but it's not replacing the parameter in the request body (JSON). Here is my setup and what am I doing wrong? JSR223 PreProcessor def randomValue =...
user2388556's user avatar
1 vote
1 answer
1k views

JMeter - Filter in JSON Extractor by JMeter Variable

I'm trying to use the JSON Extractor in JMeter 5.1 to get at a value (an id) in a ReactJS app so that I can use this value in the URL of an api call to a DELETE. My JSON payload looks something like ...
rick-pri's user avatar
1 vote
1 answer
7k views

How to extract multiple named values from a JSON object with jMeter

I want to extract all the serviceItemId's, this object I got it from an external system and I have to verify the contents are correct or not. The used JSON Object: [ [ { "...
Thamilvendan Perumal's user avatar
1 vote
2 answers
101 views

Do I need JSON schema validation for these APIS?

Here's the situation: I have a number of APIs that are unit tested. A swagger spec (swagger 2.0) is auto generated from code annotation on the APIs. I'm tasked with validating the API endpoints. In ...
PixelPlex's user avatar
  • 121
1 vote
1 answer
250 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 ...
Sarang123's user avatar
1 vote
2 answers
5k 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 }...
Madhi's user avatar
  • 13
1 vote
1 answer
119 views

Codeception: test data in annotation - codeception reports undefined variable

I've tried to use this style: https://codeception.com/docs/07-AdvancedUsage#Example-Annotation My example test case is this: /** * @example { "groupid": "16789507", "...
pavelsaman's user avatar
  • 4,548
1 vote
2 answers
2k views

How to extract rcAuth Token from header and POST as parameter to call an API

I'm automating email verification process, For that I have an API where I have to pass the emailID with the URL e.g.http://apiqa.somewebsite.in/api/v1/verify-email-qa/[email protected] and have ...
NarendraR's user avatar
  • 1,573
1 vote
1 answer
8k views

keeping the test data in json format [closed]

This is my selenium code. I am just finish my selenium code. I'm following page object pattern. My code does not follow any frameworks. 1). I want to keep the test data separately. Not ...
toastmaster's user avatar
1 vote
4 answers
3k views

How to compare 2 JSON string having different attributes but same value?

I'm working in a Migration API Testing project also I'm new to API testing. I have this scenario - There are 2 services, Service A and Service B. Service A has the response like this when I request ...
user3810877's user avatar
1 vote
0 answers
139 views

How are JSON Web Token validators tested?

JSON Web Tokens (JWTs) are an open, industry standard method for representing claims securely between two parties. There are numerous implementations for JWT verification but it looks like each ...
dzieciou's user avatar
  • 10.5k
1 vote
1 answer
993 views

JSON Assertions in CA LISA

Has anybody tried scripting json response assertions in CA LISA Tool. All I could find was string match where I was giving "key":" value" exactly to ensure the presence of that combination in my web ...
Web Nash's user avatar
  • 111
0 votes
1 answer
835 views

What is the best way to create complex json in java?

I want to create a request body to test an API. The request body is a complex JSON as below: { "certificate_registry": { "images": [ { "url": "https://path.jpg" } ], ...
The Sun's user avatar
  • 139
0 votes
1 answer
874 views

What are the best ways to Automate JSON POST Request using Restassured API

What are the best ways to Automate JSON POST Request using Restassured API. My POST request is too big and all my endpoints requests are too bit. Appreciate your help on this. For Ex: { "...
shyam's user avatar
  • 1
0 votes
3 answers
5k views

JMeter - Post Data passes JSON data

The Project which I am working now require a performance test. So, I preferred JMeter for a load test and started learning one by one. Now, When I recorded a test and included a CSV file for the ...
N Ali's user avatar
  • 1
0 votes
2 answers
46 views

Why are there JSon processors in Jmeter

I know that JSON is another way for data transmission like XML. Now there might be some data transmitted with JSON tags (like in xml tags). so my questions is why people are using JSON. secondly how ...
Faiz's user avatar
  • 809
0 votes
1 answer
532 views

how to insert generated id from response , into the endpoint

I'm testing API, using Rest assured, programming language is java. Is there any way to get the generated id from a response body and insert it into the endpoint? I have the following endpoint {baseUrl}...
Qa Automation's user avatar
0 votes
1 answer
174 views

Python How to find a key in a nested dict [closed]

I am currently automating an application that is available across multiple platforms. We have a common JSON file per page denoting the elements locator as below: { "XYZ": { "default&...
Ranadheer's user avatar
0 votes
2 answers
556 views

Jmeter | Groovy functions aren't working

I am currently following the 'Blazemeter Jmeter Pro' certification training and while working on an exercise, I noticed that for some reason, the groovy functions aren't working for me. Let me show ...
Goodguy Charlie's user avatar
0 votes
1 answer
6k 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, ...
Upkar Singh's user avatar
0 votes
1 answer
5k views

How to read data from JSON file , Then Pass these values on web application form with the help of Xpath Locators and Then Write it in Excel file?

Steps : Can you suggest the approach or share some sample script 1.Read data from JSON file - Method to Provide Data (JsonReader.getdata) - Get file location & File Name 2.In @Test(...
Akshay Dongar's user avatar
0 votes
2 answers
2k views

From an Json Object, I am trying to extract the values by using the below code in JSR223 processor

{ "service": "CURBSIDE", "unavailableLines": { "unavailableLine": [ { "unavailableQty": "10.0", "itemLineId": "4", ...
Thamilvendan Perumal's user avatar
0 votes
1 answer
109 views

How to duplicate part of tags in XML in Jmeter

I have this JSON template { "shipToAddress":{ "country":"SE", "emailAddress":"[email protected]", "zipCode":"${zipcode}" }, "itemLines":{ "itemLine":[...
Thamilvendan Perumal's user avatar
0 votes
1 answer
120 views

I am trying to extract a part of Json response, where i am not able to find the correct regex [closed]

{ "shipToAddress":{ "country":"SE", "zipCode":"AB101AA", "emailAddress":"[email protected]" }, "deliveryArrangementsId":"DA100000011", "itemLines":{ "itemLine":[{ "unitWeight":"...
Thamilvendan Perumal's user avatar
0 votes
1 answer
2k 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": [ { ...
Mohammed A Zahid's user avatar
0 votes
1 answer
1k views

What is the use of waitForPageLoad() method in Framework when our test scripts don't execute unless the page is loaded by default

public void waitForPageLoad(WebDriver driver){ while(true){ String page_status =(String)((JavascriptExecutor)driver).executeScript("return document.readyState"); if(page_status....
Ram Patro's user avatar
0 votes
1 answer
27 views

Is it possible to validate response with json schema file in karate?

Need to validate just the structure from response with schema file not the data values. Is it possible to do in karate?
user58322's user avatar
0 votes
2 answers
329 views

Is there a way to put an entire part of a request in a SoapUI variable?

I'm using SoapUI to test REST webservices and I'm stuck on an issue. I have a json object, called coverages, which consists of one or more other objects, it looks something like this (example with 2 ...
Jan G.'s user avatar
  • 1
0 votes
1 answer
91 views

How to create correct JSONArray in Java using JSONObject [closed]

I'm trying to create a JSONArray but having difficulties cause the format I need to create is as follows: "header": [ { "name": "x", "id": &...
Selenium QA's user avatar
0 votes
1 answer
1k views

Send the same JSON several requests but with different value in a node via POST with Apache JMeter

I am testing the behavior and performance of an endpoint and I have a JSON to test it, so I am sending via HTTP POST that JSON with Apache JMeter. When sending a single request there is no problem (...
Sebastian's user avatar
0 votes
1 answer
275 views

Json Path extractor using Jmeter

Using Json extractor from the below response I would like to extract the only customerProductIdentifier where highLevelProduct is HSI, and in my next Json extractor similarly would like to extract the ...
Mohammed A Zahid's user avatar
-1 votes
1 answer
6k views

Postman PUT returns success, but parameters are null in response body

I am trying to update employee details on following URI http://dummy.restapiexample.com/api/v1/update/24 The request body is: { "employee_name": "DorisWan", "employee_salary": "50000", "...
Vishal Pawar's user avatar