TestComplete script - What am I doing wrong?
function findAndClick_BtnAssociacao()
{
var BtnAssociacao = Sys.Browser().Page("*").Panel("tabs").Panel("tabs_1").Panel(0).Panel(1).Panel(0).Panel("panelInicial").Find(Array("contentText"), Array("Associação"), 1000);
// find a button and see if it is enabled
if (BtnAssociacao.Exists && BtnAssociacao.Enabled) {
// if found
// click on it
BtnAssociacao.Click();
// find a panel that is shown just if the button BtnAssociacao is found
var PnlTitle = Sys.Browser().Page("*").Panel("tabs").Panel("tabs_1").Panel(0).Find(Array("ObjectType", "idStr", "contentText"), Array("Panel", "title", "Associação"), 1000);
// while the panel doesn't exist, i'll perform a click on BtnAssociacao
while (!PnlTitle.Exists) {
BtnAssociacao.Click();
}
// If not found or not enabled, error log generated
} else {
Log.Error("The attempt to click on the specified menu have failed.");
}
}