|
我觉的你的CODE 有点问题.1 FUNCTION 应有RETURN 值.要是没有.最好定义SUB
2 .什么地方要用括号给你PASTE 一段QTP USER GUILDE 的内容:
Using Parentheses
You must use parentheses around method arguments if you are calling a
method that returns a value and you are using the return value.
For example, use parentheses around method arguments if you are
returning a value to a variable, if you are using the method in an If
statement, or if you are using the Call keyword to call an action or function.
You also need to add parentheses around the name of a checkpoint if you
want to retrieve its return value
The following example requires parentheses
Set WebEditObj = Browser("Mercury Tours").Page("Method of Payment").
WebTable("FirstName").ChildItem (8, 2, "WebEdit", 0)
WebEditObj.Set "Example"
Call RunAction("BookFlight", oneIteration)
or
Call MyFunction("Hello World")
because the method is used in an If statement.
If Browser("index").Page("index").Link("All kind of").
WaitProperty("attribute/readyState", "complete", 4) Then
Browser("index").Page("index").Link("All kind of").Click
End If
NO Parentheses
Browser("Mercury Tours").Page("Method of Payment").WebTable("FirstName").
Click 3,4
The following example requires parentheses around the
It u want to check whether text box is visible or not
If Browser("TEST").Page("TEST").WebEdit("FirstEditBox").GetROProperty("visible") = TRUE Then
Reporter.ReportEvent 0, "pass", "pass"
Else
Reporter.ReportEvent 1, "fail", "fail"
End If |
|