Ask a Question

Windows save as dialog is not recognised properly

komalak11
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
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.


Robert Martin
[Hall of Fame]
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
Vegas Thrill Rider
Extensions available
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.");

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
[Hall of Fame]
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
Vegas Thrill Rider
Extensions available

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?


Marsha_R
[Community Hero]
____
[Community Heroes] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Heroes]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Hero] signature is used with permission by SmartBear Software.
https://community.smartbear.com/t5/custom/page/page-id/hall-of-fame
komalak11
Contributor

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
SmartBear Alumni (Retired)

Hi @komalak11,

 

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

---------
Tanya Yatskovskaya
SmartBear Community and Education Manager



Hi,

 

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

anupamchampati
Frequent Contributor

Can you please share the MSAA settings?

Try removing (*) from the list.

cancel
Showing results for 
Search instead for 
Did you mean: