Ask a Question

WaitProperty not detecting that property is not at expected value

SOLVED
ThomasCasserly
Frequent Contributor

WaitProperty not detecting that property is not at expected value

Hi all, 

 

I have a WaitProperty step in my keyword test, I am trying to check if a button is enabled or not before the test proceeds, so have selected the button as the object and "Enabled" property as the value to check, with the Property value set to True.

Issue is that when I run the test, with the button disabled, the test does not stop on the WaitProperty operation, so appears to not be checking the Enabled status of the button. See screenshots for details

4 REPLIES 4
tvklovesu
Frequent Contributor

Waitproperty will not stop the script. It will just wait either te state got changed or till the time you specified. To make the script stop you need to add if statement after this wait to read the Last operation result and see if that wait statement failed or not.

 

 

tvklovesu_1-1675436030764.png

Waiting for Object State Changes | TestComplete Documentation (smartbear.com)

 

 

rraghvani
Trusted Contributor

The PropertyName should be Enabled and not e.g. Aliases.buttonMybtn.Enabled.

 

For example,

 

function Test1()
{
    Aliases.buttonMybtn.WaitProperty("Enabled", true, -1);
}

 

 

rraghvani_0-1675438481394.png

 

Thanks for that, I thought that selecting the property as per my original screenshot would just select the "Enabled" property. Didn't realise that it was looking for a property named with the full alias.

Ok, didn't realise that was the case. I thought all test steps would cause the test to stop if they couldn't be completed. Thanks.

cancel
Showing results for 
Search instead for 
Did you mean: