How to solve error when QTP cannot identify object



while running recorded application in QTP ,it gives error


Cannot identify the object "OK" (of class WinObject). Verify that this object's properties match an object currently displayed in your application

Line (3): "Window("Window").Window("Login").WinObject("OK").Click 32,10".

can some pls give solution of this problem ,QTP gives this error for all drop down in application i recorded

Questions by sangeetasingh268

Showing Answers 1 - 2 of 2 Answers

akothuru

  • Jun 11th, 2008
 

Use the Statement at the begining of the script/function "On Error Resume Next". This is the concept of Exception Handling.

If you use this statement in your script, it simply ignores any type of Error Popup messages at runtime and executes the next statement/line of the script. But It simply skip the line which gets the Error Popup message and no action performed for that line.

If you want to send this error type/description to Test results, then use the following code at end of the script/function

If Err.Number <> 0 Then
  ErrorNumber =" Error # " & CStr(Err.Number)
  ErrorDescription = Err.Description
  Reporter.ReportEvent micFail, "Error Message: " & ErrorDescription , "Failed"
  Err.Clear 
End If

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions