|
5#
楼主 |
发表于 2007-4-25 13:01:52
|
只看该作者
hi,winfood 代码和图片见下面
Set WebTableInstance=Browser("CNF").Page("DetailsApplication").WebTable("VersionsList")
Call TestDeleteOneVersion("New Version (2)",1,0,"WebElement",2,"Link",0,0,WebTableInstance)
Sub TestDeleteOneVersion(ApplicationVersionName,NameObjectCol,NameObjectPosition,NameObjectMicClass,DeleteObjectCol,DeleteObjectMicClass,DeleteObjectPosition,DeleteConfirm,WebTableInstance)
RowNum=WebTableInstance.RowCount
For i=2 to RowNum
If WebTableInstance.ChildItem(i,NameObjectCol,NameObjectMicClass,NameObjectPosition).GetROProperty("innertext")=ApplicationVersionName Then
WebTableInstance.ChildItem(i,DeleteObjectCol,DeleteObjectMicClass,DeleteObjectPosition).Click
Exit For
End If
Next
If Browser("CNF").Dialog("DeleteApplicationVersionConfirm").Exist(2) Then
If DeleteConfirm=1 Then
Browser("CNF").Dialog("DeleteApplicationVersionConfirm").WinButton("OK").Click
Wait 1
If CheckExistentApplicationVersion(ApplicationVersionName,NameObjectCol,NameObjectPosition,NameObjectMicClass) Then
Reporter.ReportEvent micFail,"Failed in","Delete Application Version"&ApplicationVersionName
Else
Reporter.ReportEvent micPass,"Succeed in","Delete Application Version"&ApplicationVersionName
End If
ElseIf DeleteConfirm=0 Then
Browser("CNF").Dialog("DeleteApplicationVersionConfirm").WinButton("Cancel").Click
Wait 1
If CheckExistentApplicationVersion(ApplicationVersionName,NameObjectCol,NameObjectPosition,NameObjectMicClass) Then
Reporter.ReportEvent micPass,"Succeed in","Cancel deletion operation"&ApplicationVersionName
Else
Reporter.ReportEvent micFail,"Failed in","Cancel deletion operation"&ApplicationVersionName
End If
End If
Else
Reporter.ReportEvent micFail,"Failed in","Found Deletion confirm prompt box"
End If
End Sub
[ 本帖最后由 dcyan 于 2007-4-25 21:04 编辑 ] |
|