开发者

Selenium Test - Check if url returns a pdf

开发者 https://www.devze.com 2023-02-05 16:11 出处:网络
I have a selenium test I am creating.The application creates a pdf for the user.I want to know how to test that a url returns a pdf file.I don\'t really care what is in the pdf, just that one开发者_JA

I have a selenium test I am creating. The application creates a pdf for the user. I want to know how to test that a url returns a pdf file. I don't really care what is in the pdf, just that one开发者_JAVA技巧 got created.

  • FYI - The url does not container .pdf

    http://www.url.com/printp/something.php?pld=b8eiub9w6ar2am1i


Alternatively, make a HEAD request first to check if the url is created, then inspect content_length header, which should be nonzero size, or whatever is reasonable minimum size in your case.


Can you test if //meta[contains(@http-equiv,Content-Type)][contains(@content,pdf)] exists!

I did not test !

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号