function CheckPropertyExists(ObjPropNameArray:OleVariant,ObjPropValuesArray:OleVariant,DispMsg:OleVariant=nil,Parent:OleVariant=nil,WaitTime:OleVariant=nil,IsLogError:boolean=true):boolean;
var
objToChk : OleVariant;
i:integer;
warningTxt,propName,propVal:string;
begin
try
try
if IsNullNil(DispMsg) then
DispMsg := 'Waiting for the object to appear on the screen';
Indicator.Show;
Indicator.PushText(TidyString(DispMsg));
objToChk := Utils.CreateStubObject;
if IsNullNil(Parent) then
begin
Parent := LOTS_Main_GetLotsParentObj;
if not Parent.exists then exit;
end;
if IsNullNil(WaitTime) then
begin
WaitTime := Project.Variables.WaitTime;
end
else
WaitTime := VarToInt(WaitTime);
for i : = 0 to WaitTime/1000 do
begin
if not Parent.exists then break;
objToChk := Parent.FindChild(ObjPropNameArray,ObjPropValuesArray,1000,false);
Parent.Refresh;
if ((objToChk.Exists) and (objToChk.Visible)) then break;
aqUtils.Delay(2000,Indicator.Text);
end;
//check to see if the property is visivle on screen
{if objToChk.Exists then
begin
if not objToChk.VisibleOnScreen then
Log.Warning('The object exists but is not visible on screen');
end;}
for i := VarArrayHighBound(ObjPropNameArray, 1) downto 0 do
begin
propName := #13#10+propName+' Property Name ' + TidyString(i+1) +': '+ TidyString(ObjPropNameArray[i])+' '+#13#10;
propVal := #13#10+propVal+' Property Value ' + TidyString(i+1) + ': ' +TidyString(ObjPropValuesArray[i])+' '+#13#10;
end;
warningTxt := 'Unable to find the propety with Property Details' + #13#10
+ 'Object Property Names : ' + #13#10
+ propName + #13#10 +
+ 'Object Property Values : ' + #13#10
+propVal + #13#10
+' Total Delay Used : ' + TidyString(WaitTime);
except
Log.Error('Exception in CheckPropertyExists routiene,click on addtional Information tab for details... ',exceptionmessage);
end;
finally
if not objToChk.Exists then
begin
if IsLogError then
begin
Log.Error('Failed to find the Property,click on addtional Information tab for details... ' ,warningTxt,300,nil,Sys.Desktop.Picture());
end;
result := false;
end
else
begin
result := true;
end;
Indicator.PopText();
end;
end;