cancel
Showing results for 
Search instead for 
Did you mean: 

Windows save as dialog is not recognised properly

Occasional Contributor

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?

 

SaveAsDialog.PNG

8 REPLIES 8
Community Hero

Re: Windows save as dialog is not recognised properly

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.


Robert Martin
[Community Expert Group]
Please consider giving a Kudo if I write good stuff
----

Why automate?  I do automated testing because there's only so much a human being can do and remain healthy.  Sleep is a requirement.  So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.

Mysterious Gremlin Master
Extensions available
Contributor

Re: Windows save as dialog is not recognised properly

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.");

Community Hero

Re: Windows save as dialog is not recognised properly

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.


Robert Martin
[Community Expert Group]
Please consider giving a Kudo if I write good stuff
----

Why automate?  I do automated testing because there's only so much a human being can do and remain healthy.  Sleep is a requirement.  So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.

Mysterious Gremlin Master
Extensions available
Community Hero

Re: Windows save as dialog is not recognised properly

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?

Highlighted
Occasional Contributor

Re: Windows save as dialog is not recognised properly

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.

Community Manager

Re: Windows save as dialog is not recognised properly

Hi @komalak11,

 

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

---------
Tanya Gorbunova
SmartBear Community Manager

Join the annual community event and share your stories to win gifts
Wintertainment2019
Occasional Contributor

Re: Windows save as dialog is not recognised properly

Hi,

 

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

Contributor

Re: Windows save as dialog is not recognised properly

Can you please share the MSAA settings?

Try removing (*) from the list.