Click() fails on a button accessed through getAccessibleChild()
I am evaluating TestComplete 7.51, and am writing a JScript that will install my application using InstallShield. I want to run the InstallShield and then click on the "Next" button.
Our build server builds the application in a different folder (according to date) every day, so I don't think that I can add the InstallShield to the TestedApps. In my test, I start InstallShield using the windows explorer and get the InstallShield window with
javaw = Sys.WaitProcess("javaw", 600000);
In the InstallShield main window there is a panel with 3 buttons "Cancel" "Previous" and "Next". I get the panel using
PropArray = new Array("JavaClassName", "Visible");
ValuesArray = new Array("ZeroGf9", true);
ConvertedPropArray = ConvertJScriptArray(PropArray);
ConvertedValuesArray = ConvertJScriptArray(ValuesArray);
mainpanel = javaw.FindChild(ConvertedPropArray, ConvertedValuesArray, 8);
Then I find the "Next" button thus:
childno = mainpanel.getAccessibleChildrenCount;
for ( i = 0 ; i < childno ; i ++ )
{
nextbtn1 = mainpanel.getAccessibleChild( i ) ;
if ( nextbtn1.text.equals("Next") )
break;
}
Then I want to click the "Next" button, so I do:
nextbtn1.Click();
but this gives me a Microsoft JScript runtime error: Object doesn't support this property or method
I don't understand why.
If instead I access the "Next" button through Aliases for a particular instance of InstallShield, like this:
Aliases.javaw.frame0.RootPane.null_layeredPane.null_contentPane.ZeroGge.ZeroGf9.ZeroGgb1.Click();
then I can use it. But I don't think that I can use Aliases with an application which is not in the TestedApps and in any case the button names are created dynamically, so they are different every time.
What am I doing wrong?
Best Regards
Tina