2015-03-31 45 views
0
Set ParentObject=Browser("Title:=Sign-In").Page("Title:=Sign-In Home Page") 
PropertyRequired="name" 
PropertyValue="Agree and Login" 
Result="yes" 


Function WebButton(ParentObject,PropertyRequired,PropertyValue,Result) 
Call ReportResult(Result) 
Dim hit 
hit=0 
    If PropertyRequired="" then 
     PropertyRequired="name" 
    End If 

If ParentObject.WebButton(PropertyRequired &":="&PropertyValue).exist then 
    ParentObject.WebButton(PropertyRequired &":="&PropertyValue).click 
    hit=1 
End if 

If hit>0 then 
    Reporter.reportevent micpass,"The button: "&PropertyValue,"Clicked sucessfully" 
else 
    Reporter.reportevent micpass,"The button: "&PropertyValue,"not Clicked sucessfully" 
End if 
End Function 

当我调用此函数后,显示错误“错误的参数数或无效的属性分配”。错误的参数数量或hp无效的属性分配错误UFT

Call WebButton(ParentObject,PropertyRequired,PropertyValue,Result) 
+0

没有给予任何的行号?你能提供完整的代码吗? – vins 2015-04-01 20:12:08

回答

0

我刚刚执行了一段代码,我没有发现任何问题。

0

尝试调用Reporter.reportevent时,所以它是这样使用圆括号:

Reporter.reportevent (micpass, "The button: " & PropertyValue, "Clicked sucessfully") 
相关问题