Ask a Question

handle file download in browser

RUDOLF_BOTHMA
Community Hero

Re: handle file download in browser

Just a further note on the above:

 

If it is because it requires a desktop license, it comes into play even earlier than when you try to access BrowserWindow methods in script and that may be why I can find it without technically tying up a desktop license.  BrowserWindow(0) is available for me to map in the Object browser right off the bat and I was able to NameMap it:

 

 

 

Browserwindow mapping.JPG

 

This is unfortunaly the extent of what I can assist.  I haven't tried any other means of downloading files yet, sorry.


-------------------------------------------------
Standard syntax disclaimers apply
Regards,
vthomeschoolmom
Super Contributor

Re: handle file download in browser

Yes browser window cannot find and windows.

 

TanyaYatskovska
Community Manager

Re: handle file download in browser

Hi @vthomeschoolmom,

 

Have you seen this sample?

Download a file from the Internet

 

I think only Platform objects are used there.

---------
Tanya Yatskovskaya
SmartBear Community and Education Manager

Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️
vthomeschoolmom
Super Contributor

Re: handle file download in browser

I will check it out. Thanks!

vthomeschoolmom
Super Contributor

Re: handle file download in browser

No love.

Sub Test
  Dim strFileURL, strHDLocation, objHTTP, objADOStream, objFSO 
  
  ' Specify the names of the source and destination files
  strFileURL = "http://www.automatedqa.com/file to get"
  strHDLocation = "c:\temp\filename"

I am looking for means to handle the USER INTEFACE within the browser. 

 

TanyaYatskovska
Community Manager

Re: handle file download in browser

I see. In this case, you will need to work with the Browser's dialogs. I'm not sure if TestComplete has access to them. Usually, browsers blocks iteration with their own dialogs. UI Automation or MSAA would help. However, as far as I remember they are in the Desktop module.

---------
Tanya Yatskovskaya
SmartBear Community and Education Manager

Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️
RUDOLF_BOTHMA
Community Hero

Re: handle file download in browser

Is it critical to work with the user interface or is it simply that the popup is getting in the way of your download ?

 

If it's the second option, you could (this is IE only, but could be modified for chrome etc..) change the Default download path for the browser to one you know.  Downloads folder will work fine as well I guess.  Secondly, get rid of the confirmation box that gets displayed when you try and download.  Now you won't get prompted and the file will just show up in your downloads folder.  In everyday use, this is dangerous.  In a controlled environment, it's fine.

 

Something like:

 

https://jwcooney.com/2014/03/31/remove-internet-explorer-open-or-save-popup/ 

 

Disclaimer: I haven't tried or read the article in-depth.  Just suggesting a potential alternative approach


-------------------------------------------------
Standard syntax disclaimers apply
Regards,
TanyaYatskovska
Community Manager

Re: handle file download in browser

Hi @vthomeschoolmom,

 

Did you find the solution you decided to use?

---------
Tanya Yatskovskaya
SmartBear Community and Education Manager

Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️
vthomeschoolmom
Super Contributor

Re: handle file download in browser

Not really. Such is the nature of browser apps. I guess I will just cause each browser not to require a prompt for download. I don' t love it. But it is what it is.

cancel
Showing results for 
Search instead for 
Did you mean: