In headless=False (headed mode):
- We click an element (e.g., a file name like
ProjectAttachedFile1.pdf). - A new page is opened with the embedded PDF viewer.
Switch Page NEWworks correctly, and we can access the PDF and download it.
In headless=True:
- The click triggers no new page creation.
- After running
Switch Page NEW, we’re still on the same page (verified via${pages}= Get Page Idswhich shows only one). - As a result, the PDF page isn’t accessible, and download fails.