Forum Discussion

meenakshiyadav1's avatar
meenakshiyadav1
Contributor
10 years ago

test complete not recognizing save button in a popup window

Hi, I am new to  Test complete. I am using Scripting in vbscript for automation. I am trying to click on a button in a popup window. test complete is recognizing the popup window  but not the buttons (Open, save, cancel etc.) inside the window . I have checked the object browser thoroughly I can see the object for popup window but I do not see objects of these buttons anywhere. popup window object does not show any child object in object browser. Please let me know how can get clicked on "save" button in this case. This is kind of urgent!! can any one help please.

8 Replies

  • Sorry, but ....



    "Using


    On Error Resume Next



    you can skip unwanted window pop-up"




    ... is a terrible suggestion!



    All that will do is switch off the error handling so it doesn't crash when the popup being there prevents the test from being able to use a control on the page below it.



    The popup window will still be there.



    Any subsequent steps that try and use the page will also fail - as the popup will still be in the way.



    So no, I absolutely would NOT recommend this approach!


  • Hi! There is a property TestObj.PopupMenu, you can read more about it to push F1 on it. It's for "The top-level windows and controls.". May be it help.
  • Ravik's avatar
    Ravik
    Super Contributor
    Hi Meenakshi,



    Try this solution may help you to click on Save button on Window Pop-up


    Function CheckWindowAlert



    Set Alert = Sys.Browser("iexplore").Page(aqString.Concat(Project.Variables.Var1,"*")).FindChild("ObjectIdentifier", "Save", 70)



    If Alert.Exists Then



    alertDetails = Sys.Browser("iexplore").Window("#32770", "Message from webpage", 1).Window("Static", "*", 2).WndCaption



    Alert.Click



    Else



    log.message("Window pop-up does not exists")



    End If



    End Function



    OR



    Using



    On Error Resume Next



    you can skip unwanted window pop-up



    Thanks

    Ravik



     



     


  • Ravik's avatar
    Ravik
    Super Contributor
    Hi Colin,



    I am agree with your post. "Using


    On Error Resume Next



    you can skip unwanted window pop-up"


     its really not a good approach, Please check my solution code too.



    Please let us know which is the best approach for this.

  • Sometimes I prefer to use the method Keys to simulate the user interaction.

     


     


    Sys.Keys("Y")     // 'Yes'


    Sys.Keys("N")    // 'No'


    Sys.Keys("O")   // 'Ok'

  • vickybalu222's avatar
    vickybalu222
    Occasional Contributor
    Hi,

    Please Check the MSAA and TextRecognition Activate for the Window in Project Level