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 !
精彩评论