Select and upload file using Tosca Testsuite

3.3k views Asked by At

It is possible to automate a test which selects a file from your computer and upload it online? I tried to scan the windows of my computer which show when you click the upload button online but it seems it is not possible.

2

There are 2 answers

1
MartinThé On BEST ANSWER

If I understand you correctly, you are scanning a website with upload functionality.

Just scan the upload button of the website. Most websites then show the operating system's "Open File" dialog. For automation you could simply paste the path in the "Open File" dialog and hit enter or click open.

0
Xandi On

A bit late but for anybody still wondering how to handle file uploads from the browser:

  1. Add a test step using TBox Wait standard module and set a delay of 2000 ms or so. This is the time necessary for the file system to open the file upload dialog.
  2. Add another test step after the previous one using TBox Save Save As standard module and configure the parameters for this test step as described in point 3 to 5.
  3. Set Caption param to the title of the file dialog window. This can depend on OS locale or program settings.
  4. Set FilePath param to the your absolute file location.
  5. Set Button param to the label of the button that confirms the selected file and closes the dialog. Again, this depends on the OS locale. On English Windows OS the value would be Open.

Hope this helps!