I am working on BDD framework with cucumber and Junit. I have scenario to upload an asset then publish. Once the asset is published it will reach to different 3rd party application. We have access for few 3rd application to validate. But in few other website we do not have the access to the UI, so we need to send a API get request then we will receive the response about asset is present or not.
I am wondering is there any way to send the API get request through selenium after performing the some functional steps.
step 1: Send a post request, it will send a response like below.
{
"totalAssetsModifiedOrCreated": 1,
"totalAssetsDeleted": 0,
"deletedAssets": [],
"hits": [
{
"path": "/content/dam/global-asset-library/Products/automation/download.jpg",
"renditions": [
"/content/dam/global-asset-library/Products/automation/download.jpg/jcr:content/renditions/cq5dam.web.1280.1280.jpeg"
],
"metadata": {
//Asset metadata
},
"previewLink": "https://qa.dam.com/content/dam/global-asset-library/Products/automation/download.jpg?qtm=1637340248265"
}
],
"status": {
"code": "200",
"message": "Search results found.",
"success": true
}
}
Step 2: Send a get request using the preview link in the above response.
Step 3: validate the previously published asset returned(ex: Image)
Your help is highly appreciated. Thank You.