Here are some of the sample test cases for File Upload.
Set the file size required for the webapp. Make sure file upload module recognizes the limits of file size.
If you allow only specific set of files then whitelist those file types.
Depending on the programming language, set the content type for the files being uploaded.
File upload module should have the file type recognizer functionality built into it.
File upload feature should remove the special characters within the textarea field if provided.
Accept alphanumeric content in the file names.
Accept characters and alphanumeric content in names.
Don’t accept the file types that leads to SQL injection.
Include server level file scan.
Don’t accept empty files with extension that leads to SQL injection.
Restrict file name typing instead offer file browsing dialog box to upload button.
Authorize the file upload and transfer to only registered accounts if required.
Make sure server side checks for the file size limits.
Create new copy of the same uploaded file to avoid overwriting.
Check if the file with number as file name is accepted for file transfer.
Check if the file with maximum character is accepted for file transfer.
Check if the file without extension is accepted for file transfer.
Check if a file that exceeds maximum number of characters by 1 (max+1) can be sent.
Check if the file with 1 character or number is allowed to transfer.
Check if the file transfer can be initiated and finished on 2G Edge network.
Check if the file transfer can be initiated and finished on 3G network.
Verify if the file transfer speed meet the specification of the test.
Check if it is possible to upload the file that exceeds the upload speed specification and allowed upload bandwidth limit.
Verify the time taken by the upload process by uploading multiple files under test.
We should also think about the file upload feature in terms of security issue. Here are some security options to check while testing the application.
Upload black listed files and try executing.
Upload executable file and execute on server.
Upload HTML file with XSS script embedded into it.
Upload virus file and measure the response.
Upload files consistently without any wait period (denial of service check).
Try to upload file as a guest user or anonymous user.
Here are some of the test cases and scenarios that you should consider while manual testing the module.
Is the uploader limited to single file or the multiple file?
Is the uploader drag and drop type?
Does the uploader requires browsing to file using browse button?
Does the uploader depends on any third party plugin?
Is the uploader custom built or makes use of existing framework?
Does the uploader supports drag and drop from tablet app?
Does the uploader gets affected by third party plugins or API if it is dependent on their services?
Does the uploader has any third party API security issues?
Does the uploader includes progress bar to show estimated time left for file upload?
Does the file uploader displays file size uploaded?
Does the file uploader has any file size requirements?
What are the minimum file size requirements of file uploader?
Does the file size has any limits?
Can you upload the file size outside the limitations of the uploader?
What are the maximum file size accepted in the uploader?
Does the uploader accepts image files in the format – jpg, gif, png?
Does the uploader accepts document formats – pdf, doc, txt, xlsx?
Does the uploader has any other specific application format requirement?
Does the uploader has any specific file format blacklisted for security reasons?
What are the some of the file formats white listed by the uploader?
Does the system allows cancelling the upload?
Does the system allow cancelling multiple uploads?
Does the uploader open browse for file dialog box when clicked on button?
Does the uploader shows “success” message after upload?
Does the uploader shows error message if failed?
How does the uploader behaves if the no file is uploaded?
How does the uploader respond if some files in multi upload fail?
What message does it display if the files failed to write on server space?
What message is displayed if the chosen file only gets partially uploaded?
What message is shown if the file exceeds maximum file size?
Verify that while uploading multiple files simultaneously, so latest file is overriding the previous file or not.
Verify that while uploading multiple files one by one, so latest file is overriding the previous file or not.
Verify that if any file open then that file can be uploaded or not.
Verify that while uploading multiple files simultaneously, so if any file among all open then uploading will be interrupted or not
Verify that uploading multiple files from different locations simultaneously.
Verify that Cancel uploading in middle of uploading multiple files simultaneously.
Verify uploading multiple files of different format.
Verify that uploading files from another website or webpage by url of that file.
Verify that try to upload files from any online repository.
Verify that any edit or crop is possible after selecting the file in file picker for upload.
Verify that same file name must be shown while uploading and same file must show after uploading.
Verify that uploading any video, image etc. file while shooting or creating or writing etc. and also streaming etc.
Verify that Drag and drop functionality for uploading the files.
To verify that after clicking on Upload button file selection window should open.
To verify that after clicking on the cancel button of selection window that window should be closed.
To verify that select any file for upload & in between uploading process cancel that task, After clicking on cancel no any file & file part should be uploaded.
To verify that in between uploading process click on upload button again (In the standard scenario it should be disable).
To verify that after selecting file if file too big in size then proper message should be display.
To verify that check for file type which going to upload after selection of file.
To verify that check without select any file and entered path like ( c:/Test.doc) file.
To verify that some time entered cross script then show server side error.
To verify that start uploading the file and disconnect network.
To verify that check server timeout(There usually is a Timeout for file upload)
To verify that check upload from a disc which has no space left(usually the data will be cached to temp for rolling back)
To verify that check upload for Folder(its should not be the case)
To verify that check for multiple file uploads.
To verify that check for compressed /Readonly /Archived file uploads.
To verify that test for same file upload many times i.e. depends on the functionality some servers may rename it to xFilie_1, some may just add a new version e.g. Sharepoint. some may simply deny.
To verify that check for uploading a file within maxi mb
To verify that check for uploading a file equal to maxi mb
To verify that check for uploading a file greater than maxi mb
To verify that check if file is unable to upload then we can upload the same file again or not?
To verify that upload files with large number of path files.
To verify that Upload file from folder click upload then remove file from System.
To verify that upload same file name and extension name file like ppt.ppt
To verify that upload file from Network and then power off PC.
To verify that upload blank file
Here few more cases:
Maximum Size
File Type
Not Supported File Type
Browse - Should open File Explorer
Display the selected File path
Maximum Length of the File Name
File with Alphanumeric Characters
Multiple Files selection
Multiple Files display format
Exe /Corrupted File Upload
SDL - HTML Tag Validation,Scripting
Should display uploaded file as Hyperlink
Drag and Drop Upload
Cancelling Upload
Multiple Clicks of Upload
Success Message
Error Message
Multiple Version Upload of Same File
Deleting for Uploaded File
Confirmation Message for Delete
Chosen File Partially Uploaded
Error Message on maximum file size exceeded
Blank File Upload
Scanning before Upload
Error Message on uploading same file again
Upload File from shared path on network
Upload File within Folder
Copy Paste of File Name in the Text Field
Upload File Name with Space
Downloading the uploaded File
Error message on Invalid Path
Timeout with slow network speed
Unplugin Internet Connection during Upload
Close Browser while Uploading
Change the file extension during Upload
Rename the File during Upload
Edit the file during Upload
Browse should be disabled during upload
Different Browsers
File Attributes should be same before and after download