Ask a Question

Downloading a JSON file after hitting soap UI https request

Occasional Contributor

Downloading a JSON file after hitting soap UI https request

have one requirement to automate in SOAP UI Open source

Where I need to hit a https url and after hitting the url I need to download a json file for further use

I am able to login and browse the file location by using Basic Authorization.

In response, I can see the files name in html format.But further I wanted to download the file in local machine or to see a content of the file in the soap UI response so that assertions can be added.

Please suggest if there is any other approach in soap UI where we can download a file or see a content of file after hitting the https URL.

Hi @sparrowenclave,


Here is a sample script to browse a directory containing json files and open each to find a specific node.


import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.ArrayList;
import java.util.List;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
import static;

File newFile;
String FolderPath = "<insert your path here>";
File selectedDirectory = new File(FolderPath);
List<Path> paths = new ArrayList<>();

try {
  paths = Files.walk(Paths.get(new File(selectedDirectory.getPath())
              .filter(p -> p.toFile().isFile())
} catch (IOException e) {

for (Path path : paths) {
  newFile = new File(path.toString());
  ObjectMapper mapperFileSource = new ObjectMapper();
  JsonNode rootNode = null;
  try {
      rootNode = mapperFileSource.readTree(newFile);
  } catch (IOException e) {
  JsonNode searchNode = rootNode.findValue("<insert a node name here>");
  if (searchNode != null) {;
      // You can add assertions here


It is just an example of what can be done.

Keep in min you'll need jackson's library.
Hope this will help.



Community Hero


This is great...people ask for this every so often and now there's a definite way of doing it. I'll be saving this for when this pops up in my work, so nice one!

if this helped answer the post, could you please mark it as 'solved'? Also if you consider whether the title of your post is relevant? Perhaps if the post is solved, it might make sense to update the Subject header field of the post to something more descriptive? This will help people when searching for problems. Ta
Showing results for 
Search instead for 
Did you mean: