Error while executing "Execute" method in test complete.
objectFullNameString is a object having fullname of object.
Execute objectFullNameString &"."& "CheckItem("&"""|Sectors|LZONE Classification|Banks|Axis Bank Ltd"""&", True)"
When we are executing the Execute Method system is giving following error.
"Microsoft VBScript compilation error."
"Cannot use parentheses when calling a Sub"
Please suggest what to do in this case
Thanks in advance
RE: Error while executing "Execute" method in test complete.
Your string evaluates to something like this:
In VBScript, if you use parenthesis when calling a subroutine, you must also use the Call keyword. If you don't use the Call keyword, the argument list must NOT be surrounded by parenthesis.
So, you need to either use the Call keyword:or remove parenthesis from the CheckItem method call:
By the way, a shorter and simpler way to do the same thing is to evaluate only the object itself rather than the whole statement:Call Eval(objectFullNameString).CheckItem("|Sectors|LZONE Classification|Banks|Axis Bank Ltd", True)
Eval(objectFullNameString).CheckItem "|Sectors|LZONE Classification|Banks|Axis Bank Ltd", True
SmartBear Documentation Team Lead
Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️