Forum Discussion

komalak11's avatar
komalak11
Contributor
5 years ago

Windows save as dialog is not recognised properly

Hi,

 

I am running a desktop application, while saving a project with the same name, a Replace yes pop up appears on the screen. Now when i want to handle this object, both the Save As dialog and Replace yes dialog have the same name and properties, hence no matter how i try to handle it, Replace Yes button is always unrecognised. Can someone help me out how to handle such overlapping windows?

 

8 Replies

  • tristaanogre's avatar
    tristaanogre
    Esteemed Contributor

    Well, technically, they DON'T have the same properties... there is probably some combination of properties that determines one from the other.  This is going to take some examination of your part to determine where the difference is.

  • anupamchampati's avatar
    anupamchampati
    Frequent Contributor

    Try with the below code, it can loop for any possible button with Yes in the screen and it will click on it.

     

    var PropArray = new Array("WndCaption", "Visible");
    var ValuesArray = new Array("Save As", true);
    var SaveAsWindow = Sys.Process("Application Name").FindChild(PropArray, ValuesArray);

    if (PrintDoc.Exists)

    {

    SaveAsWindow .btnYes.Click()

    }

    else
    Log.Error("The object was not found.");

    • tristaanogre's avatar
      tristaanogre
      Esteemed Contributor

      YOu're only using the caption and whether or not it is visible... there are more properties to choose from than that.

       

      Use the Object Spy and examine the popup dialg for other property/value pairs.  There may be a WndClass or something else you can use as well.  As I said, you'll need to examine the properties of the object to determine the differentiation.

      • Marsha_R's avatar
        Marsha_R
        Champion Level 3

        Are you trying to test the replace or could you just delete that file when you are finished with it each time and avoid the replace altogether?

  • I will try to find a combination of the properties and create the Name Mapping and let you all know if i can resolve the error.

    • TanyaYatskovska's avatar
      TanyaYatskovska
      SmartBear Alumni (Retired)

      Hi komalak11,

       

      Do you mind sharing the progress on this issue? What solution did you decide to use?

      • komalak11's avatar
        komalak11
        Contributor

        Hi,

         

        I am still working on the issue, once resolved I will post an update.

  • anupamchampati's avatar
    anupamchampati
    Frequent Contributor

    Can you please share the MSAA settings?

    Try removing (*) from the list.