How to Fix General Run Error?

Reason why “General Run Error” will occur:

This is one of the common errors of UFT. There are different scenarios where this error will occur. For example

If you pass the wrong number of arguments to a function then this error will occur.

For more information just check the below example:

Function NavigateToMainMenu(strLInkName,strStepName)
 
     Set Olink= Browser(“OrangeHRM”).Page(“OrangeHRM”).Link(“innertext:=”&strLInkName)
     If Olink.Exist(0) Then
         strBGColor=Olink.GetROProperty(“background color”)
         
     If strBGColor=”#f28c38″ Then
         Reporter.ReportEvent micDone,strStepName,”The menu option is already selected”
         Else 
             Olink.Click
             Reporter.ReportEvent micPass,strStepName,”Link is clicked successfully”
             
     End If
     else
      Reporter.ReportEvent micFail,strStepName,”The link doesnt exist,Pls check link name once again”
      
     End if
     
 End Function

If you see the above example NavigateToMainMenu( ) function need two parameters while calling it.

But if we call the same function like

navigatetomainMenu( )

                                OR

navigatetomainMenu(“Click on PIM menu”)

General Run Error will occur

Solution:

Now the question is “How to Fix General Run Error?”

You need to pass right arguments to the function