Mar
29
2008
0

Debugging general run error

So you got a General run error while running your code and are not sure on what to do?

What does General run error mean?

General run error occurs when an underlying source being accessed by QTP throws an error. QTP instead showing the error text shows a “General run error”.

General run error

General run error

A typical example would be the below line of code

Set oGeneralRunError = GetObject("X.Y.Z")

Running the above code would generate a general run error. But running the same code in VBSript would generate the below error

Invalid syntax error

Invalid syntax error

So the actual error is Invalid Sytax and not the “General run error”. To look at the actual error in such a case, click on the Debug button and open the watch window. Type the below in the Watch window

DescribeResult(Err.Number)
Using DescribeResult to get the Actual error

Using DescribeResult to get the Actual error

How to fix general run error ?

  • If you are getting this error while working on a QTP test object, then put a Msgbox to check the existence object being worked upon
  • In case of Web environment using DOM object methods could be of the solution
Rating: 7.0/10 (6 votes cast)