Hello JWebUnit Users,

 

I'm wondering if there's a better way to approach this testing scenario:

 

I have a web page that lists a varying number of PDF files available for
download. Clicking a PDF link calls a servlet that retrieves the file
from a database. I need to test downloading the PDF files and also query
the content/text in each.

 

My approach: 

JWebUnit clicks first PDF link that triggers the file to download. I
save the response to disk using saveAs(File). I plan to use
JPDFUnit/PDFBox to 'see inside' the PDF files and check content. To
repeat and download the next PDF file, I call gotoPage() to get back to
the list of PDF reports.

 

I'm wondering about the following:

1.       When I run through the above scenario using a browser, I get a
download dialog. After opening/saving the PDF from the download dialog,
the web page listing the PDF files is still visible. Is there another
way to get back to the web page listing the PDFs without calling
gotoPage? gotoFrame, gotoWindow etc. don't seem to work

2.       Is there a way I can get to the PDF content instead of saving
it to disk first? A method similar to getServeurResponse() but for
binary responses would be needed

 

Thanks,

Clinton

 

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
JWebUnit-users mailing list
JWebUnit-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jwebunit-users

Reply via email to