ContributionsMost RecentMost LikesSolutionsRe: TC4 FocuscontrolFinal working code: Function FindFocusCountrol(OBJ, ACaption); var I; PropArray, ValuesArray; s : WideString; begin PropArray := CreateVariantArray(0, 0); ValuesArray := CreateVariantArray(0, 0); PropArray[0] := 'Caption'; ValuesArray[0] := ACaption; I := obj.find(PropArray, ValuesArray, 1); if I.Exists then begin Result := i.FocusControl; Result := OBJ.VclObject(Result.Name); end else begin Result := Null; end; end; Re: TC4 FocuscontrolIn Evalute Dialog Result.ID, Result.FullName [xxx : Property does not exist] From Help: The following methods and properties are common for all processes, windows, controls and onscreen objects. Common Properties Common PropertiesCommon PropertiesName Description _NewEnum Returns an enumerator for the collection of children that belong to the object. ChildCount Returns the number of child objects of the current object. Exists Informs whether an object exists in the system. FullName Specifies the full name that uniquely identifies the object in TestComplete. Id Returns the ID of the current object. MappedName Returns the custom name, which is mapped to the original name of the object, as a string. Name Returns the name of the object as a string. Parent Returns the parent object of the current one. Why "Property does not exist"???? Re: TC4 FocuscontrolHi property Name exist. If I in Evalute dialog enter Result.name and click Evalute I get "[name : Property does not exist]" If I in Evalute dialog enter Result.Name and click Evalute I get correct name. But in code I wrote "Result.Name" and I get exception :( Re: TC4 FocuscontrolResult := I.FocusControl; Result := i.Parent.Find('NativeDelphiObject.Name', Result.Name); Exception: Undeclared identifier: name s : WideString. S := I.FocusControl.Name Exception: Undeclared identifier: name But on TC I see property Name and it have a correct value :( TC4 FocuscontrolHi, ALL I have Delphi Form with the Label (TLabel) and Lookup (Created in runtime, name random). I can find label by its caption, I can get object from TLabel.FocusControl. Function FindParam3(OBJ, ACaption): OLEVaraint; var I; PropArray, ValuesArray; begin PropArray := CreateVariantArray(0, 0); ValuesArray := CreateVariantArray(0, 0); PropArray[0] := 'Caption'; ValuesArray[0] := ACaption; I := obj.find(PropArray, ValuesArray, 1000); if I.Exists then begin Result := i.FocusControl; end else begin Result := Null; end; end; But this object has different interface that I can found from TC object browser. I needed TestComplete method KEYS and other. How to typecast FocusControl to TLookup? Or how to I can get Focuscontrol.NativeDelphiobject.Name (Lookup.name)? Or other way to get VCL Control with runtime name generation?