iTest2 Recorder cannot catch the 'download' dialog

2 views
Skip to first unread message

Nadim

unread,
Dec 21, 2009, 5:34:38 AM12/21/09
to iTest2
Hello
I am using using iTest2 1.7.3 trial version. My page has a link
button and clinking on this link it downloads a pdf file. When I
click on this button a default firefox download dialog is displayed
and click save button of this dialog will save the pdf file. But
recorder cannot write script for the download dialog. What can I do?

Nadim

Zhimin

unread,
Dec 21, 2009, 6:37:45 AM12/21/09
to iTest2
Nadim,

Testing file download with dialogs is feasible in Watir, see
http://wiki.openqa.org/display/WTR/File+Downloads

However I generally not recommend this approach, as it might be error
prone when your test suite get large and run in continuous build
server.

Here is another way to verify file download: fast, not dialog, can
check file size and content type.

scenario "Upload file attachment" do
require 'httpclient'
client = HTTPClient.new
message = client.get("http://itest2.com/downloads/
itest2recorder.xpi")
message.contenttype.should =~ /text\/plain/
message.content.size.should == 35683
end

Zhimin

Reply all
Reply to author
Forward
0 new messages