0
votes

This one is making me a little crazy and I hope someone can help.

I added a wait(45) line to my QTP script and when it runs I get a type mismatch error.

I know this will occur if a function can't be called or I misspell something to be called or etc.

But, this is a simple WAIT statement. Nothing else on the line.

Line: 152
Char: 6
Error: Type mismatch: 'Wait'
Code 800A000D

Any ideas? Did I miss something? How can there be a type mismatch on Wait?

2
It works for me both with and without the parenthesis. Could it be something caused by the surrounding code? - Motti

2 Answers

0
votes

There definitely is no Wait() sub or function in VBScript; as this question indicates, this holds for QTP too.

As to the error: a missing sub/function throws a type mismatch:

>> nosuchsub
>>
Error Number:       13
Error Description:  Type mismatch

(If this consoles you, I don't like it neither.)

0
votes

Actual error is not in Wait function. QTP shows type mismatch error due to compilation error in previous lines. Check all your library files are properly added. Best method to find the root cause of problems like this is to divide your code into smaller functions / procedures and test each function.