Article Overview:
This article will cover how you can achieve the following: Live Authoring, PDF, Download
- Address and resolve situations where Virtuoso gets stuck on the "Running" status when attempting to view a PDF file.
- Ensures that PDFs are correctly opened within the Virtuoso testing environment.
Problem Statement:
Virtuoso may get stuck on the "Running" status when attempting to open a PDF file triggered by a button click. This issue occurs when the PDF is opened in a new tab via a URL instead of being downloaded directly by the browser. As a result, .the ShowPDF
function fails, causing the test to stall.
Solution:
-
Step 1: Verify the behavior of the PDF file. Ensure that the PDF is being opened in a new tab rather than downloaded directly. This can be observed by checking if the PDF URL is being stored in the
LAST_DOWNLOADED_FILE
variable. -
Step 2: If the PDF is not automatically downloading and instead opening in a new tab, consider modifying the anchor tag to explicitly mark the link as a download. This can be done by appending
download='somepdf.pdf'
to the anchor tag, forcing the browser to download the file rather than open it in a new tab. -
Step 3: Run the test in Live Authoring mode to observe the behavior. If the PDF is successfully downloaded, the
LAST_DOWNLOADED_FILE
variable should reflect the correct file and size. - Alternate Solution: In some cases, the issue was intermittently resolved by using the Firefox browser in advanced execution mode. While this approach provided a temporary workaround, it may not be consistently reliable.
-
Final Step: Refer to the Virtuoso guide for alternative methods to handle PDF files. This guide suggests modifying the link behavior or using specific extensions designed to ensure proper file handling during automated tests.
Examples:
If a user encounters Virtuoso stalling when a PDF opens in a new tab instead of downloading, modifying the anchor tag to force the file to download resolves the issue. This adjustment ensures the PDF is correctly downloaded, allowing the test to continue without interruptions.
Comments
0 comments
Please sign in to leave a comment.