t) Verify that component uploads the file and the statistics are shown correctly
(E5100175)
i) Steps
- new project
- drag a basic > static text on to the designer and label it 'Download
a File', set the style/font to something large.
- drag a basic > file Upload component onto the designer and label it 'Select
a File: ' (Skip label due to bug!)
- drag a basic > button onto designer and label it 'Upload File Now'
- drag a basic > textArea on to designer, and label it 'Contents of File:',
set the columns to 60 and the rows to 5.
- drag a basic > messge Group onto the designer
- double click the button and add the following source (merge: com.sun.web.ui.model.UploadedFile;)
UploadedFile uploadedFile = (UploadedFile)
fileUpload1.getUploadedFile();
info("Uploaded file originally named '" +
uploadedFile.getOriginalName() +
"' of size '" +
uploadedFile.getSize() +
" ' " );
textArea1.setText(uploadedFile.getAsString());
- Right click and do Fix Imports
- deploy/run the application
- browse and select a file
- Be sure to test files with space in path, space in name, as well as
ones without.
- The src folder under this folder contains a series of files that can
be used.
- press the Upload File Now button
o) expected results
- The textArea should display the contents of the file.
- The message group should display the name and size of the file.
- Repeat at least 2 times
- Note for manual testers!: Be sure to test when fileUpload has a lable,
and when it doesn't. 6366690
On the EA forum, 2 users have reported, and I have verified,
that file1.getUploadedFile() returns null when using IE. I
know it isn't on your radar yet (because of Gregory's list) but when it is you
might want to check it out.
Logged as 6330658.