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?
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.
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);
Log.Error("The object was not found.");
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.
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.
Do you mind sharing the progress on this issue? What solution did you decide to use?