|
systemUtil.Run "www.51testing.com"
wait 10
Browser("micClass:=Browser").Navigate "bbs.51testing.com"
Browser("micClass:=Browser").page("micClass:=page").Sync:wait 1
checkURL = Trim(Browser("micClass:=Browser").Object.LocationURL)
If checkURL = "http://bbs.51testing.com/" Then
Reporter.ReportEvent micPass,"STEP1","Passes"
else
Reporter.ReportEvent micFail,"STEP1","Failed"
End If
Browser("micClass:=Browser").OpenNewTab:wait 2
testHWND = Browser("name:=新建选项卡").GetRoProperty("hwnd")
msgbox testHWND
Browser("name:=新建选项卡").Navigate "bbs.51testing.com"
Browser("51Testing软件测试论坛 软件测试 |").Page("51Testing软件测试论坛 软件测试 |").Link("登录").Click
With Browser("51Testing软件测试论坛 软件测试 |").Page("51Testing软件测试论坛 软件测试 |_2")
.WebEdit("用户名").Set "cgysylove"
.WebEdit("密码").SetSecure "531875e24232f2938e43b3ac02e7f9de367c92a49218"
.WebButton("登录").Click
End With
oExist = Browser("51Testing软件测试论坛 软件测试 |_2").Page("51Testing软件测试论坛 软件测试 |").Link("退出").Exist (3)
If oExist Then
Reporter.ReportEvent micPass,"STEP3","Passed"
else
Reporter.ReportEvent micPass,"STEP3","Failed"
End If
msgbox testHWND
msgbox "hwnd:="&testHWND
Browser("hwnd:="&testHWND).close
Browser("micClass:=Browser").Refresh:wait 3
oExist = Browser("51Testing软件测试论坛 软件测试 |_2").Page("51Testing软件测试论坛 软件测试 |").Link("退出").Exist (3)
If oExist Then
Reporter.ReportEvent micPass,"STEP4","Passed"
else
Reporter.ReportEvent micPass,"STEP4","Failed"
End If
*****************
在执行关闭第二个选项卡时,提示对象不可见,从运行上看,第二个选项卡不是活动项,但是第二个选项卡却能够执行输入账号密码登陆的操作
求助:怎么使用句柄关掉第二个选项卡,或者怎么让第二个选项卡设置为激活状态 |
|