Here's the online documentation for the Find method. https://support.smartbear.com/testcomplete/docs/reference/test-objects/members/common-for-all/find-method.html
In the meantime, here's the requested code example.
function findExample(){
var textboxUserName;
textboxUserName = Aliases.browser.pageWebOrdersLogin.Find(['ObjectType','ObjectIdentifier'],['Textbox','username'],3,true);
if (textboxUserName.Exists){
textboxUserName.Keys('test');
}
}
Note that I've mapped the page in my Aliases. Technically speaking I could map this one level further since I don't want to seach the whole page, I just want to search the components in the login panel. so, I map the panel as panelLogin... in which case the above code alters to this:
function findExample(){
var textboxUserName;
textboxUserName = Aliases.browser.pageWebOrdersLogin.panelLogin.Find(['ObjectType','ObjectIdentifier'],['Textbox','username'],1,true);
if (textboxUserName.Exists){
textboxUserName.Keys('test');
}
}
So, this will find the object as a child of panelLogin which is a much smaller scope of objects to search. But, honestly, is redundant because the UserName object will ALWAYS be the same identifications... so, I'd prefer, in this case, to map the UserName field. The properties used in the mapping are the same properties and values indicated in the Find method... So, my code simplifies even further.
function findExample(){
var varUserName;
varUserName= Aliases.browser.pageWebOrdersLogin.panelLogin.WaitAliasChild('textboxUserName', 5000);
if (varUserName.Exists){
varUserName.Keys('test');
}
}
There's no need, here, to "find" anything, just simply to check if the object as mapped exists. If it does, the code continues. All the "finding" is taking place within the TestComplete core functionality and, because this is compiled code and not interpreted script code, it will ALWAYS operate faster.