Hi Dominic,
Instead of
'Goto_URL command to open the PDF in Chrome by entering the following value in the URL: data:application/pdf;base64,@ngbv2PdfByteArray'
You can use a step with Execute_Javascript command with the below:
var link = document.createElement("a");
link.download = 'file_name';
link.href = 'data:application/pdf;base64,@ngvb2PdfByteArray';
document.body.appendChild(link);
link.click();
document.body.removeChild(link);
delete link;
So this Javascript step will download your pdf file to local environment
Then, you can use Goto_url and open the next url: file://path_to_the_file
It's better to generate file name on the fly using Set_Var random step, the download path can be specified in the browser options
Regards,
Subject7 Team
Answered
Error with Verify_Text_In_PDF
Scenario/Steps:
- Used a Get_Rest_Value command to make a REST call that returns a PDF Byte Array.
- Saved that PDF Byte Array into a var called @ngvb2PdfByteArray
- Used Goto_URL command to open the PDF in Chrome by entering the following value in the URL:
data:application/pdf;base64,@ngbv2PdfByteArray
- PDF is opened in browser
- Used Verify_Text_In_Pdf to verify a text value of 'FA8T' but receive an error from Subject7:
"Error during url parsing: unknown protocol: data"
4 comments
Sort by
Date
Votes
Please sign in to leave a comment.