Hello,
Is it possible to Assert and / or capture a screenshot of a non-html based page in the web browser? Specifically, I have a case where clicking a link on the site opens a new window which displays a PDF file (personally I would convert it to a pure HTML page instead of using PDF, but unfortunately it isn't my call). When I right-click the resulting page I am unable to view the source, but if I inspect the element via Chrome tools I do see a title within the appropriate <title> tags, which I assume the browser is generating somehow.
When I run my test it opens the page as expected on screen, but the saved screenshot is a blank 815px x 908px jpg and the Assert of the title fails. I've included a sanitized version of the test method below; using this method on HTML based pages work just fine, so I know that my setup and tear down are ok.
[Test]
public void VerifyPdfWindowOpens()
{
var saveFilePath = "FOLDER_PATH";
browser.SaveScreenshot(saveFilePath, ImageFormat.Jpeg);
Assert.That(browser.Title == "PAGE_TITLE");
}
"PDF isn't supported" is of course an acceptable answer; I just want to make certain I'm not doing it wrong if it is supported. :)
Thanks for you time,
Dan