2015-03-31 65 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") 
相關問題