Often times, your test logic may require uploading a file from a browser based application. Since this operation involves interacting with OS native screens (i.e. File Explorer), ACCELQ provides a couple of different options to accomplish this operation.
Command: Upload File with Element
This command uploads a file using a Web Input element on the browser screen. You just point to the element on the screen which is usually clicked to open the File Browser.
Note that the File Explorer is not physically displayed in the automation run. It uploads the file using send-keys on the input field. This is a portable command on all operating systems, so the same logic can run on Windows, Mac or Linux machines.
Parameters
File Name |
Path to the file to upload. Note: File path can be absolute path accessible from the Local Agent machine, or relative path in the Agent's installation folder. Learn more |
File Element |
Input element on the browser screen, which needs to be clicked to open file explorer. |
Identifying the Element to use:
Typically, the element passed to this command is of type, "<input type="file">. However, depending on your application logic, this element may not be directly accessible or visible on the screen. ACCELQ automatically searches through the given element's hierarchy to get to right element to operate on. So, you can still succeed by providing a visible element that accomplishes the file upload.
Here are a few examples. In the images below, red highlighted element can be used for uploading the file
Example 1: File Upload Button
Example 2: File Upload Area
Command: Upload File with Windows Explorer
This command is helpful to physically interact with Windows Explorer and open the file. Include a separate step in your test logic to click on the upload button element before using this command. Here is a snippet
Note: This command is applicable only when running the test on Windows machine.
Comments
0 comments
Please sign in to leave a comment.