Jump to content
Sign in to follow this  

Check for Download dialog in IE 11?

Recommended Posts

Hi guys,

I am writing an automated website test script and have a page with some download links to test.

The site is in ASP.NET MVC, the download link is like this: https://websiteurl.com/services/download?linkAddress=download%2Finteractive-sdk.zip

I can click the link via the DOM and IE11 brings up the download message at the botton of the window.

When I used Au3Info.exe and mouse over the download dialog I see:

>>>> Control <<<<
Class:    DirectUIHWND
Instance:    1
ClassnameNN:    DirectUIHWND1
Advanced (Class):    [CLASS:DirectUIHWND; INSTANCE:1]


I tried using:


But it showed the class name "DirectUIHWND1" before and after download dialog appeared in browser.

so I thought maybe it was just hidden, so I tried:

ControlCommand( "[CLASS:DirectUIHWND; INSTANCE:1]", "", "", "IsVisible", "")

but is returned 0 both before and after download dialog appeared in browser.


So I guess I am going about it the wrong way. Does anyone have an idea, or exampe of checking for the IE11 download dialog or perhaps another method of verifying the file is availble for download?

Edited by cyanidemonkey

Share this post

Link to post
Share on other sites

If you look through the IUIAutomation thread in the Examples forum, I know there is a post in there specifically about clicking the download button in IE (the post # escapes me at the moment).

'?do=embed' frameborder='0' data-embedContent>>

Share this post

Link to post
Share on other sites

Thanks for your help guys.

Got there in the end with:

Local $hWindow
$hWindow = WinGetHandle( "[CLASS:IEFrame]" ) ; Internet Explorer
ControlCommand ( $hWindow, "", "[CLASS:Frame Notification Bar; INSTANCE:1]", "IsVisible", "" )

It at least returns 0 before the download button is clicked and 1 after button clicked, so is enough to verify the dialog showed up at least.

Edited by cyanidemonkey

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Similar Content

    • By Andreik
      Can someone try to call this function from gdiplus.dll on a Windows 8.1 machine and confirm that is working or not? I am pretty sure it worked well on other versions but now I still get this error:
      A simple code for test can be this one:
      #AutoIt3Wrapper_UseX64=n #include <ScreenCapture.au3> #include <Memory.au3> _GDIPlus_Startup() Local $hBitmap = _ScreenCapture_Capture('',0,0,-1,-1,False) _GDIPlus_SaveImageToStream($hBitmap) _GDIPlus_Shutdown() Func _GDIPlus_SaveImageToStream($hBitmap, $iQuality = 50, $Encoder = "jpg") ;coded by Andreik, modified by UEZ, FS Local $tParams Local $tData Local $pData Local $pParams Local $sImgCLSID = _GDIPlus_EncodersGetCLSID($Encoder) Local $tGUID = _WinAPI_GUIDFromString($sImgCLSID) Local $pEncoder = DllStructGetPtr($tGUID) If $Encoder == "jpg" Or $Encoder == "jpeg" Then $tParams = _GDIPlus_ParamInit(1) $tData = DllStructCreate("int Quality") DllStructSetData($tData, "Quality", $iQuality) ;quality 0-100 $pData = DllStructGetPtr($tData) _GDIPlus_ParamAdd($tParams, $GDIP_EPGQUALITY, 1, $GDIP_EPTLONG, $pData) $pParams = DllStructGetPtr($tParams) Else $pParams = 0 EndIf Local $hStream = DllCall("ole32.dll", "uint", "CreateStreamOnHGlobal", "ptr", 0, "bool", True, "ptr*", 0) If @error Then Return SetError(1, 0, 0) $hStream = $hStream[3] DllCall($ghGDIPDll, "uint", "GdipSaveImageToStream", "ptr", $hBitmap, "ptr", $hStream, "ptr", $pEncoder, "ptr", $pParams) _GDIPlus_BitmapDispose($hBitmap) Local $hMemory = DllCall("ole32.dll", "uint", "GetHGlobalFromStream", "ptr", $hStream, "ptr*", 0) If @error Then Return SetError(2, 0, 0) $hMemory = $hMemory[2] Local $iMemSize = _MemGlobalSize($hMemory) Local $pMem = _MemGlobalLock($hMemory) $tData = DllStructCreate("byte[" & $iMemSize & "]", $pMem) Local $bData = DllStructGetData($tData, 1) Local $tVARIANT = DllStructCreate("word vt;word r1;word r2;word r3;ptr data;ptr") DllCall("oleaut32.dll", "long", "DispCallFunc", "ptr", $hStream, "dword", 8 + 8 * @AutoItX64, "dword", 4, "dword", 23, "dword", 0, "ptr", 0, "ptr", 0, "ptr", DllStructGetPtr($tVARIANT)) ;<a href='http://msdn.microsoft.com/en-us/library/windows/desktop/ms221473(v=vs.85' class='bbc_url' title='External link' rel='nofollow external'>http://msdn.microsoft.com/en-us/library/windows/desktop/ms221473(v=vs.85</a>).aspx _MemGlobalFree($hMemory) Return $bData EndFunc ;==>_GDIPlus_SaveImageToStream
  • Create New...