Want download a file that navigate to next window after clicking on that

I was able to click on the file which i want to download and save it to my local through RPA but after clicking on the file that file is opening in preview mode in a another window and that file i want to download and save it to my local.

Please help me how can i do that.

What is the file ending? PDF maybe?

Usually “opening in preview” is a browser setting and can be disabled in the browser.

Yes that is a pdf file.
I can able to disable from my browser end but if that code will run by someone and that opening in preview is not disable then what he will do.

Is there any particular Solution for this?

Try this

{
  "Name": "PDF",
  "CreationDate": "2021-6-9",
  "Commands": [
    {
      "Command": "open",
      "Target": "https://www.learningcontainer.com/sample-pdf-files-for-testing/",
      "Value": "",
      "Description": ""
    },
    {
      "Command": "storeAttribute",
      "Target": "linkText=https://www.learningcontainer.com/wp-content/uploads/2019/09/sample-pdf-file.pdf@href",
      "Value": "pdf",
      "Description": ""
    },
    {
      "Command": "executeScript_Sandbox",
      "Target": "var link = document.createElement('a');\nlink.href = ${pdf};\nlink.download = '';\nlink.dispatchEvent(new MouseEvent('click'));",
      "Value": "",
      "Description": ""
    }
  ]
}