A strange behavior of TestComplete was encountered when trying to work with standard IE File Download window. This window appears when user tries to download a file from Internet.


The problem was that TestComplete logged about successful clicking on the Open button, however no expected result happened and window just stayed as though no action was done.


We tried the following ways to solve this problem without any success:


1) Using standard Click() method

2) Simulating pressing Alt-o keyboard shortcut (it works perfectly in manual mode)

3) Setting focus to the needed control and pressing Space or Enter buttons

4) Using Click() method for the window, not for button itself

5) Using methods MouseDown/MouseUp, as well as DragMouse method

6) Windows API SendMessage() function


Some of the specified methods worked, but only one time. When we tried to run the same code second time it failed again.


At least working solution was found, however it looks a bit strange.

function MegaClick( obj )

{

   for( i = 1; i <= 2; i++ )

  {

     if( obj.Focused )

      obj.Parent.Keys( "[Tab]" );

     while( !obj.Focused )

      obj.Parent.Keys( "[Tab]" );

  }

  obj.Click();

}

For unknown reason the button should be focused twice (that’s why “for” statement has been used). After this standard method Click() works correctly.


Undoubtedly, this is not a good style and such functions should be used as workaround only. At least the “while” statement isn’t necessary, because it moves the focus through all the controls inside the window. However, this is not critical for File Download window because there are a few child controls inside it.

You must be logged in in order to post comments