How to get the downloaded files in test designer?

The solution to this is using a function known as getDownloadedFiles(). This particular function is used to get the downloaded files. It can be passed through a variable. This function can be used as shown below:

var [] filedownloadedList = getDownloadedFiles(),

To get the file path from the downloaded list, use as below:

var filepath = fileDownloadedList.getJSONObject(0).getString("path")

where “fileDownloadedList” is a variable that has been used to store the downloaded file. This function is fetching the path of the downloaded file and stores it in a variable.