|
'Step 1
'Browser("[QuickTest Pro] - 51Testing软件测").Page("[QuickTest Pro] - 51Testing软件测").Link("高级模式").Click
Htmldisabled=Browser("[QuickTest Pro] - 51Testing软件测").Page("[QuickTest Pro] - 51Testing软件测_2").WebCheckBox("html代码").Object.disabled
Htmlchecked=Browser("[QuickTest Pro] - 51Testing软件测").Page("[QuickTest Pro] - 51Testing软件测_2").WebCheckBox("html代码").GetROProperty("checked")
Imgdisabled=Browser("[QuickTest Pro] - 51Testing软件测").Page("[QuickTest Pro] - 51Testing软件测_2").WebCheckBox("[img] 代码").Object.disabled
Imgchecked=Browser("[QuickTest Pro] - 51Testing软件测").Page("[QuickTest Pro] - 51Testing软件测_2").WebCheckBox("[img] 代码").GetROProperty("checked")
Print Htmldisabled
Print Htmlchecked
Print Imgdisabled
Print Imgchecked
If Htmldisabled="True" and Htmlchecked="0" and Imgdisabled="True" and Imgchecked="1" Then
Reporter.ReportEvent micPass,"Step 1","Passed"
Else
Reporter.ReportEvent micFail,"Step 1","Failed"
End If
'Step 2
Dim vTrue : vTrue="True"
Dim vFalse : vFalse="False"
Browser("[QuickTest Pro] - 51Testing软件测").Page("[QuickTest Pro] - 51Testing软件测_2").WebCheckBox("关注此主题的新回复").Object.checked=vFalse
checkVal1=Trim(Browser("[QuickTest Pro] - 51Testing软件测").Page("[QuickTest Pro] - 51Testing软件测_2").WebCheckBox("关注此主题的新回复").Object.checked)
Print checkVal1
Browser("[QuickTest Pro] - 51Testing软件测").Page("[QuickTest Pro] - 51Testing软件测_2").WebCheckBox("使用个人签名").Object.checked=vFalse
checkVal2=Trim(Browser("[QuickTest Pro] - 51Testing软件测").Page("[QuickTest Pro] - 51Testing软件测_2").WebCheckBox("使用个人签名").GetROProperty("checked"))
Print checkVal2
If checkVal1 = "False" and checkVal2 = "0" Then
Reporter.ReportEvent micPass,"Step 2","Passed"
Else
Reporter.ReportEvent micFail,"Step 2","Failed"
End If
'Step3
Browser("[QuickTest Pro] - 51Testing软件测").Page("[QuickTest Pro] - 51Testing软件测_2").WebCheckBox("回帖仅作者可见").Object.checked=vTrue
checkVal3=Browser("[QuickTest Pro] - 51Testing软件测").Page("[QuickTest Pro] - 51Testing软件测_2").WebCheckBox("回帖仅作者可见").GetROProperty("checked")
Print checkVal3
If checkVal3= "1" Then
Reporter.ReportEvent micPass,"Step 3","Passed"
Else
Reporter.ReportEvent micFail,"Step 3","Failed"
End If
这段代码是成功的,为什么下一段代码的检查点2和3是错的?
'Step 1
'Browser("[QuickTest Pro] - 51Testing软件测").Page("[QuickTest Pro] - 51Testing软件测").Link("高级模式").Click
Htmldisabled=Browser("[QuickTest Pro] - 51Testing软件测").Page("[QuickTest Pro] - 51Testing软件测_2").WebCheckBox("html代码").Object.disabled
Htmlchecked=Browser("[QuickTest Pro] - 51Testing软件测").Page("[QuickTest Pro] - 51Testing软件测_2").WebCheckBox("html代码").GetROProperty("checked")
Imgdisabled=Browser("[QuickTest Pro] - 51Testing软件测").Page("[QuickTest Pro] - 51Testing软件测_2").WebCheckBox("[img] 代码").Object.disabled
Imgchecked=Browser("[QuickTest Pro] - 51Testing软件测").Page("[QuickTest Pro] - 51Testing软件测_2").WebCheckBox("[img] 代码").GetROProperty("checked")
Print Htmldisabled
Print Htmlchecked
Print Imgdisabled
Print Imgchecked
If Htmldisabled="True" and Htmlchecked="0" and Imgdisabled="True" and Imgchecked="1" Then
Reporter.ReportEvent micPass,"Step 1","Passed"
Else
Reporter.ReportEvent micFail,"Step 1","Failed"
End If
'Step 2
Dim vTrue : vTrue="True"
Dim vFalse : vFalse="False"
Browser("[QuickTest Pro] - 51Testing软件测").Page("[QuickTest Pro] - 51Testing软件测_2").WebCheckBox("关注此主题的新回复").Object.checked=vFalse
checkVal1=Trim(Browser("[QuickTest Pro] - 51Testing软件测").Page("[QuickTest Pro] - 51Testing软件测_2").WebCheckBox("关注此主题的新回复").Object.checked)
Print checkVal1
Browser("[QuickTest Pro] - 51Testing软件测").Page("[QuickTest Pro] - 51Testing软件测_2").WebCheckBox("使用个人签名").Object.checked=vFalse
checkVal2=Trim(Browser("[QuickTest Pro] - 51Testing软件测").Page("[QuickTest Pro] - 51Testing软件测_2").WebCheckBox("使用个人签名").GetROProperty("checked"))
Print checkVal2
If checkVal1 = vFalse and checkVal2 = vFalse Then
Reporter.ReportEvent micPass,"Step 2","Passed"
Else
Reporter.ReportEvent micFail,"Step 2","Failed"
End If
'Step3
Browser("[QuickTest Pro] - 51Testing软件测").Page("[QuickTest Pro] - 51Testing软件测_2").WebCheckBox("回帖仅作者可见").Object.checked=vTrue
checkVal3=Browser("[QuickTest Pro] - 51Testing软件测").Page("[QuickTest Pro] - 51Testing软件测_2").WebCheckBox("回帖仅作者可见").GetROProperty("checked")
Print checkVal3
If checkVal3= vTure Then
Reporter.ReportEvent micPass,"Step 3","Passed"
Else
Reporter.ReportEvent micFail,"Step 3","Failed"
End If |
|