Forum Discussion
Hello BenoitB , I must be doing something wrong, can you check my code?
I placed your example in my script, which will be called by the main keyword, the script will be called when the option to show the button is clicked, once is clicked the following function is run, but it keeps choosing "throw error", I am sure it has not been 30 seconds, in other words, it fails right away.
function WaitForButton()
{
var button = Aliases.browser.pageExam.buttonOn
aqPerformance.Start("DefaultCounter", false);
if (button.WaitProperty("Enabled", true, 30000))
throw Error("TC Failed : Enabled button state not occured within 30s !");
Log.Message("TC Success : Enabled button state occured in " + aqPerformance.Value + "ms");
}
Does your button has the Enabled property ?
The WaitProperty exit directly (what you have) when the property asked is missing :
Result Value
If the property achieves the specified value within the timeout, the method returns True. Otherwise, if the timeout elapses before the property achieves the specified value, the method returns False.
Also, False if the object does not have the specified property.
Put a breakpoint on line aqPerformance.Start("DefaultCounter", false); and when you come in, spy the button object.