cagan
4 years agoOccasional Contributor
How to handle if not finding on objects is not an error
I have a teststep for saving a file. On windows you know how to save as works. It can directly save or a pop-up window asks you do you want to overwrite with same name. Briefly, a file can be directly saved or it can overwrite. Both option is applicable for me.
So i don't want to take en error when save as window is appeared on the screen. Below code takes error like "Cannot obtain the window with the windowclass...." How can i fix the problem? Thank you
var saveAsWindow= Saveasobject
if (saveAsWindow.Exists)
{object.clickbutton();
Log.Message("overwritten button is selected.")
}
else
Log.message("overwritten window is not appeared. Because it is a new file.")