When you want to download a file on Internet Explorer, it opens a download bar and we should manage it to download that. In this article, a workaround to download automatically a file on Internet Explorer 11 is provided.
When you click on the download button, the file must be manually downloadable with the following keys sequence:
The workaround consists of the execution of this auxiliary script during the UI test execution. That script will be executed after clicking the download button with the Shell function and emulates the keys sequence shown in Precondition 2.
For example, you can automate the download of the auxiliary script following the next steps:
1) Download the auxiliary script and save it in some directory, for the sake of this example it will be stored in C:// disk.
2) Create a UI test object in your KB with the following code:
// Initial navigation
&ret = shell('C:\\DownloadIE.exe',1)
3) Run the UI test in Internet Explorer 11.
Note that depending on the file size, you should include a PauseFor command after the called Shell function to wait for the download to complete.