Forum Discussion

lalit_chand's avatar
lalit_chand
Occasional Contributor
15 years ago

IE 8 | Save Button is visible on Screen but VisibleOnScreen property is false

Hi  Team,



We are using TestComplete 7.5  and IE 8  version.



We are downloading the file by clicking on the link  as links shows a File Download Box to save the file.



We are using the below script for clicking the Save button on  File Download Box



[VBscript Code]



Dim PropArray, ValuesArray, p, w  



  set iexplore = Aliases.Sys.Process("iexplore", 2)



 PropArray = Array("WndClass", "WndCaption")



 ValuesArray = Array("#32770","File Download")



  ' Searches for the window

  Set w = Sys.Find(PropArray, ValuesArray, 60)



 If w.Exists Then

    Log.Message w.FullName

  Else

    Log.Error "The object was not found."

  End If

 

 PropArray = Array("WndClass", "WndCaption")

 ValuesArray = Array("Button","&Save")

 

 ' Searches for the Save Button

 set button = w.Find(PropArray, ValuesArray, 60)

 

 

 If button.Exists Then   

    ' Click the button

     button.click

    Log.Message button.FullName

  Else

    Log.Error "The object was not found."

  End If







Script is able to select the save box but not able to click that.

 

I found that  VisibleOnScreen property is false for Save button , even though Save button is visible on screen.



Does this property play an important part on this problem.



Note: I have also attached the screenshot.





Please enlighten me in this case.



Thanks & Regards,

Lalit










12 Replies

  • Lalit,


    ... as the code shows i first selected the Save Button and then i am sending the Enter Event.


    I saw this in your code, so I guess the dialog intercepts this event somehow. (This was a continuation of my "This is how IE works" thought :-). ). I observe the same behavior on my computer where a click on the "Save" button works fine.


    I tried  a delay after the VisibleOnScreen property becomes true,  but it didn't work either.


    I see. :-( Thank you for the information.


    The Support Team is working on the problem. They will notify you as soon as they get some results.


  • Hi all,





    I'd like to share the results we got for those who might face a similar issue and get to this thread via search. 

    Focusing the button first (to make its VisibleOnScreen property become True) and sending low-level events to the button's coordinates (evaluated via the ScreenLeft and ScreenTop properties) after that via the Desktop.MouseDown and Desktop.MouseUp methods resolved the problem.