Blank Object
function LocateObject(hardPath, basePath, propArray,valuesArray, childObject)
{
try
{
Log.Message("MiscFunctions. LocateObject reached","",300,attrPathA);
var returnObject=Aliases.notepad.wndNotepad; //selected arbitrarily
if(returnObject.Exists==true)
returnObject.Close();
while( returnObject.Exists==false)
{
if(returnObject.Exists==false)
{
//Click on the Object - hard coded
var returnObject=hardPath;
}
Delay(1000); // works
if(returnObject.Exists==false)
{
var returnObject= basePath.Find(propArray, valuesArray, 1000);
}
if(returnObject.Exists==false)
{
while(!basePath.WaitAliasChild( childObject,1000).Exists==false)
Delay(1000);
}
while (returnObject.Exists==false)
Delay(1000);
}
Log.Message("MiscFunctions. LocateObject exiting","",300,attrPathA);
return returnObject;
}
catch(exception)
{
Log.Message("MiscFunctions LocateObject exception: "+exception.description,"",300,attrError);
}
}
I really do not want to use Notepad here, as a tester MAY have it open for unrelated reasons. Is there some sort of null object that does not exist that could be used for this? I have established that part of my problem in finding objects is a really slow connection to the server the application is on, and that is not going to change for the forseeable future. So I need to deal with long object load times, and the code above seems to be answering. Comments would also be appreciated. Thanks