<< Back to demos

Automatic File Uploading

Please run this macro inside the IIM browser (not Internet Explorer Plug-In).

This example macro demonstrates how to use IIM to automate file uploads, i. e. how to fill in file name.

Select file

Background: For security reason, a FILE (BROWSE) element can NOT be set automatically with the TAG command. This is a restriction of the web browser itself.

Suggested workaround demonstrated with this macro:
Circumvent the browser security with the WINCLICK command. Use the CONTENT attribute of WINCLICK to fill in the path name. So the macro does not click the Browse button, but fills in the file name directly. In this example we use "c:\test.txt" as file name.

How to adapt this solution for your file uploads:

  • Start recording
  • Use IIM to navigate to your upload page
  • On the REC tab, switch click mode to WINCLICK
  • Now click inside the file upload form box. (where the path name should be filled in later.). This gives you the WINCLICK command with the correct X= and Y= coordinates.
    winclick
  • Stop recording (or record the rest of the macro and stop then)
  • Manually add the path name to the CONTENT attribute of WINCLICK, just like in the "Demo-FileUpload" macro. You can also use a {{variable}} instead.
  • Done!

The same approach is used in the "Demo-Winclick" sample macro.

TOP