If you need to set up monitoring or load testing for web applications with file upload functionality, use EveryStep Scripting Tool Desktop to record the script.

The file upload recording is available for Chrome and mobile browsers only.

With the EveryStep Desktop, you can set up uploading of a file from an external URL up to 5MB and up to 20MB in total within a script. For example, you can record the upload of four files of 5 MB or 20 files of 1MB.

How It Works

Dotcom-Monitor does not have locally available storage. To emulate the upload process of a file, the system needs to download the file to the script from a public URL before executing the upload step. Thus, first, you need to provide a test file that will be used in the upload process by Dotcom-Monitor. As a result, Dotcom-Monitor will download the file from the provided URL to the system cloud storage and use it in the upload process each time the script is executed. There are two approaches to provide a test file to Dotcom-Monitor.

Downloading a File from the External URL

To record a file upload from an external URL, put a test file up to 5 MB to a publicly accessible URL such as Amazon S3 bucket, Azure storage, or CDN services. Then, record the file upload step in the EveryStep Recorder. While recording the step you’ll be prompted to provide the link to the test file. The system will download the file and use it in the upload operation.

Recording a File Download within the Script

Alternatively, in the EveryStep Desktop Recorder, you can record the file download and select the downloaded file to record an upload step in the script. If necessary, you can change the file name and link, as well as downloading timeout, by editing the related line in the Script Code area after recording.

Best Practices

Dotcom-Monitor executes all steps and actions in the script without delays by default. However, it typically takes some time to upload a file to a web resource. In this case, to simulate the delay and wait for the system to execute the upload step, it is recommended to add the Delay line to the script right after the upload step.

In addition, to make sure the upload was executed correctly, set up content validation after the upload step. In general, if dialog boxes or upload confirmations appear on the page after the file upload, add keyword validation or available code snippets to check if the upload step brought the expected results.

Recording the File Upload from the External URL

Check the file upload setup steps below:

  1. Download a test file up to 5 MB to a publicly accessible URL.
  2. Record the script until the point you need to upload the file.
  3. Click the corresponding button on the target page to upload the file.
  4. In the Upload Files window, provide an external link to the file you want to upload. The file will be downloaded from the provided external link to the Dotcom-Monitor cloud storage. Once downloaded the file name will be listed in the Upload Files window. Select the file checkbox and click OK. As a result, the OpenFileDialogHandler line will be added to the script automatically.

    If the file download has been recorded on the previous step of the script, select the file name right away in the Upload Files window.

  5. Add the Delay right after the upload step.
  6. Add the keyword or image validation to the script.
  7. If necessary, proceed with the recording; and stop the recording process when ready.

Find the example of the file upload script recorded in the EveryStep scripting tool below. The script contains the step of the test file download to the system storage.

// script_version=3.0; everystep_version=4.0.7706.9249; date=2/10/2021; Chrome=83.0.4103.61
Tabs.SetSize (1768, 419);
DMBrowser tab0 = null;
Step (1, "Download & Generate Test Files - https://fastest.fish/test-files");
tab0 = Tabs.NewTab ();
tab0.GoTo ("https://fastest.fish/test-files");
tab0.Link ("//A[normalize-space()=\"5MB\"]", "//A[normalize-space(text())=\"5MB\"]", "//A[normalize-space()=\"10MB\"]/preceding-sibling::A[1]").Click ();
//File Download to the system storage  
Step (2, "Download & Generate Test Files - http://ipv4.download.thinkbroadband.com/5MB.zip");
tab0.Downloading ("5MB.zip", "http://ipv4.download.thinkbroadband.com/5MB.zip");
tab0.Para ("//P[normalize-space()=\"These test files will be downloaded in full over your network connection from high speed servers. These files can be used to test your network download speed.\"]/preceding-sibling::P[1]", "//P[normalize-space(text())=\"These test files will be downloaded in full over your network connection from high speed servers. These files can be used to test your network download speed.\"]/preceding-sibling::P[1]", "/HTML/BODY/DIV/DIV/P[1]").Click ();
//File Upload using the file from the system storage
Step (3, "Gofile - https://gofile.io/uploadFiles");
tab0.GoTo ("https://gofile.io/uploadFiles");
OpenFileDialogHandler (OpenFileDialogButton.Ok, new string[1] {"5MB.zip"});
tab0.Button ("//BUTTON[normalize-space()=\"Click here\"]", "//BUTTON[normalize-space(text())=\"Click here\"]", "//BUTTON[@ID=\"dropZoneBtnSelect\"]").Click ();
tab0.Button ("//BUTTON[normalize-space()=\"Upload\"]", "//BUTTON[normalize-space(text())=\"Upload\"]", "//BUTTON[@ID=\"uploadFiles-btnUpload\"]").Click ();
Delay ("40sec".ToDuration ());
tab0.KeywordAssert ("successfully uploaded");
//File Upload from the external URL
tab0.Link ("//P[normalize-space()=\"Upload Files\"]/..", "//LI[@ID=\"li-uploadFiles\"]//A", "//LI[@ID=\"li-api\"]/preceding-sibling::LI[1]//A").Click ();
tab0.Download ("Q3UTw.htm", "https://dropmefiles.com/Q3UTw");
OpenFileDialogHandler (OpenFileDialogButton.Ok, new string[1] {"Q3UTR.htm"});
tab0.Button ("//BUTTON[normalize-space()=\"Click here\"]", "//BUTTON[normalize-space(text())=\"Click here\"]", "//BUTTON[@ID=\"dropZoneBtnSelect\"]").Click ();
tab0.Button ("//BUTTON[normalize-space()=\"Upload\"]", "//BUTTON[normalize-space(text())=\"Upload\"]", "//BUTTON[@ID=\"uploadFiles-btnUpload\"]").Click ();
Delay ("40sec".ToDuration ());
tab0.KeywordAssert ("successfully uploaded");