I am working on a bot that should be simple, but one part of it is giving me fits. The bot goes out to a public bank site like Chase.com, and downloads the Deposit Account Agreement. I have no problem with navigating to the site, or clicking the appropriate link (there are several arranged by date).
Â
Â
The issue comes in actually saving the PDF. Chrome's PDF viewer uses an embedded bar at the top, so I cannot click on the Download button. The recorder only captures the entire frame:
Â
Â
So this leaves me with a couple of questions. Number one, I am curious if anyone has ever dealt with downloading PDFs like this, and what your solution was for an embedded button.
Â
Secondly, I tried to do this via javascript, like so:
Â
var urls = document.getElementsByTagName('a');
Â
for (var i = 0; i < urls.length; i++) {
  if (urls i].innerHTML.includes('Deposit Account Agreement')) {
  if (urls i].innerHTML.includes('11/14/2021')) {
     urlsbi].download = "file.pdf";
 urls/i].dispatchEvent(new MouseEvent('click'));
    }
  }
}
Â
and while this works in the Browser Console, it does not work in the Bot - no error returned in a Try/Catch block, the Javascript action just stalls until it times out. I am curious if anyone knows why it would work in the browser but not in AA.
Â
Either way, Recorder or javascript, I need to find a way to get this to work consistently. Any suggestions would be greatly appreciated.
Â
.