Ask a Question

Waiting for Button to be enabled

SOLVED
nedbacan
Frequent Contributor

Waiting for Button to be enabled

Hello.  I am new to TestComplete and would like to ask if someone can help.

 

I need to wait for this button to becomes enable so I can move on, the enabled time varies on the button but no longer than 30 seconds. I prefer not to use the Delay command because the script will take too long to complete.

 

I am trying to use the following script in my keyword but it is giving me a code error within the script. "TypeError::WaitProperty is not a function. "  It must be something silly but because I am new to this I do not know where to start.

 

function WaitForButton() {   

var button = Aliases.browser.pageExam.buttonOn.Enabled

          if (button.WaitProperty("Enabled", true, 35000))

{

           button.ClickButton();

}
}

nedbacan_2-1610689693459.png

 

nedbacan_0-1610689390427.png

 

 

 

1 REPLY 1
tphillips
Frequent Contributor

That almost looks right, you just need to set "button" to the button object (not its "Enabled" property):

var button = Aliases.browser.pageExam.buttonOn;


--------------------
Senior SQA Automation Engineer
cancel
Showing results for 
Search instead for 
Did you mean: