Article Overview:
This article will cover how you can achieve the following:
- Address failures caused by downloading multiple PDF files during suite execution.
- Implement a solution to ensure successful journey execution.
Problem Statement:
If you experience intermittent failures during suite execution involving journeys with steps to download multiple PDFs. These journeys fail at the initial step (e.g., Navigate to $Test_URL) and return the following errors:
- "We could not execute this step to completion."
- "We are sorry, but due to an unexpected event, we could not execute this journey to completion. Please try again by re-executing this journey."
The issue does not occur when executing the journeys individually, making it difficult to troubleshoot during suite execution.
The issue arises because opening multiple PDF files causes the browser to hang. Specifically:
- A "missing title" tab appears when PDF links are clicked, disrupting browser behavior and preventing new tabs from opening correctly.
Solution:
To address this, modify the behavior of PDF links to open in the same page instead of new tabs.
Steps:
-
Execute the Following Script:
- Add a step to run this JavaScript:
- This script removes the
target
attribute from all links containing "pdf" in their URL on the current page.
-
Impact of the Script:
- All PDF links will now open in the same browser tab, avoiding the creation of new tabs that cause the browser to hang.
- All PDF links will now open in the same browser tab, avoiding the creation of new tabs that cause the browser to hang.
-
Re-Execute the Suite:
- After implementing the script step, re-execute the suite to ensure that journeys run without interruptions.
Reference Screenshot:
Example Scenario: If a customer face failures when executing journeys involving multiple PDF downloads in a suite. By implementing the script to remove the target
attribute from PDF links, this enables them to successfully execute the suite without interruptions.
Notes:
- The script applies to all links containing "pdf" on the page. Ensure that this behavior aligns with your testing requirements.
- This solution works best when combined with regular suite monitoring to confirm consistent results.
Comments
0 comments
Please sign in to leave a comment.