How to Fix Cannot Use Parenthesis When Calling a Sub Error in UFT?

This is one of the common errors in UFT. There are different scenarios where this error will occur. Below is one if the scenarios.

When you are trying to call a function name without using “Call” keyword in front of the function name, then in such case “cannot use parenthesis when calling a sub “ error  will occur.

For example if you call a function name like

ClickonButton(Browser(“OrangeHRM”).Page(“OrangeHRM”).WebButton(“html id:= btnSave”),”Click on Save Button”)

Then cannot use parenthesis when calling a sub error will occur as shown in below picture.

Solution:

To fix above error you need to write function name along with “Call” keyword as shown below.

Call ClickonButton(Browser(“OrangeHRM”).Page(“OrangeHRM”).WebButton(“html id:= btnSave”),”Click on Save Button”)

                                                OR

Call  FunctionName “ ParanthesisValue”

Leave a Reply

Your email address will not be published. Required fields are marked *