Asserting Text

If response contains a pdf file you can assert its content using pdf(body) function. http.get("/report") { pdf(body).pageText(0).should contain('Quarterly earnings:') } If more than one assertion needs to be made, assign pdf result to a local variable. http.get("/report") { def pdf = pdf(body) pdf.pageText(0).should contain('Quarterly earnings:') pdf.pageText(1).should == 'Intentional blank page\n' } Note: use pdf assertions for sanity checks like presence of correct client names or account numbers. Leave comprehensive pdf generation test to unit tests.