Ask a Question

JScript Runtime Error

kankele
Occasional Contributor

JScript Runtime Error

I have a TestComplete v10.5 application that tests a WPF application. One line of my code runs w/o issues 90% of the time, the other 10% of the time, I get a JScript runtime error "Unable to call the method. Status: Pending". My code gets a TextBox with the FindChild method (var textBox = parent.FindChild(.....), the calls the Click method of the textBox (textBox.Click()). The line that calls the Click method is where the runtime error occurs. I have no idea what this message means or how to even begin to debug this issue. Any help would be greatly appreciated.

2 REPLIES 2
NisHera
Valued Contributor

Re: JScript Runtime Error

Is  it becourse your text box is not fully created when you call it;s methoed?

can you try a bit delay before calling methoed.

if 90% ok the means your code is correct but other 10% may be due to some delay in application and it can not access what suppose to.........

Colin_McCrae
Community Hero

Re: JScript Runtime Error

"can you try a bit delay before calling methoed."

 

Is fine to see if it's a timing related problem in the first place.

 

But you shoud not be using hard coded delays as a long term solution.

 

Once you have concluded it is indeed a timing issue, use a helper function that checks for the existence/visibility/usability of the object before you try and use it. Or just extend the timeout in the project options for how long TestComplete will wait for an object before giving up and throwing an error.

cancel
Showing results for 
Search instead for 
Did you mean: