Forum Discussion
Abramova
Staff
14 years agoHi,
If you have several windows with the same caption, you can use other properties to recognize the needed window, for example, the Index property. To know the window index, explore the target window with the Object Spy and view the value of the Index property of the corresponding window object. After that, you can use the Find method to search for the needed window in the test:
function Test()
{
var PropArray, ValuesArray, p, w;
// Creates arrays of property names and values
PropArray = new Array("WndCaption", "Index");
ValuesArray = new Array("MyWindow", 2);
// Searches for the window
p = Sys.Process("MyProcess");
w = p.Find(PropArray, ValuesArray, 5);
// Processes the search results
if (w.Exists)
Log.Message(w.FullName);
else
Log.Error("The object was not found.");
}
If you still need to find the needed window by its text, you can use the Optical Character Recognition technology. For more information, please refer to http://smartbear.com/support/viewarticle/11241/.