Contributions
Re: TC4 Focuscontrol
Final 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 thenbegin Result := i.FocusControl; Result := OBJ.VclObject(Result.Name); end else begin Result := Null; end; end;1.6KViews0likes0CommentsRe: TC4 Focuscontrol
In 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"????1.6KViews0likes0CommentsRe: TC4 Focuscontrol
Hi property Name exist. If I in Evalute dialog enter Result.name and click EvaluteI get "[name : Property does not exist]" If I in Evalute dialog enter Result.Name and click EvaluteI get correct name. But in code I wrote "Result.Name" and I get exception :(1.6KViews0likes0CommentsRe: TC4 Focuscontrol
Result:= 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 :(1.6KViews0likes0CommentsTC4 Focuscontrol
Hi, ALL I haveDelphiForm withthe Label (TLabel) andLookup (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 methodKEYS and other. How to typecast FocusControl to TLookup? Or how to I cangetFocuscontrol.NativeDelphiobject.Name (Lookup.name)? Or other way to get VCL Control with runtime name generation?13KViews0likes6Comments