请大家帮忙,关于WebEdit对象
请大家帮忙,下面是代码SystemUtil.CloseProcessByName "iexplore.exe"
Dim Uname_desc,Password_desc,browsDesc,pageDesc
SystemUtil.Run "iexplore.exe"
Set Uname_desc = Description.Create()
Set Password_desc = Description.Create()
Set browsDesc = description.create()
Set pageDesc = description.create()
Uname_desc("RegularExpression").Value=False
Password_desc("RegularExpression").Value=False
Uname_desc("name").value = "loginPageView1$ctl00$txtHandle"
Uname_desc("html tag").value = "INPUT"
Uname_desc("id").value="loginPageView1_ctl00_txtHandle"
Uname_desc("type").value="text"
Password_desc("name").value = "loginPageView1$ctl00$txtPassword"
Password_desc("html tag").value = "INPUT"
Password_desc("id").value="loginPageView1_ctl00_txtPassword"
Password_desc("type").value="password"
Set curPage = Browser(browsDesc).Page(pageDesc)
curPage.Sync
Browser(browsDesc).Navigate ("http://cn.match.com/login/login.aspx")
curPage.Sync
curPage.WebEdit(Uname_desc).Set "mmtest02"
curPage.WebEdit(Password_desc).Set "password"
curPage.image("name:=続ける").Click
运行到此处就会报错Browser(browsDesc).Page(pageDesc).WebEdit(Uname_desc).Set "mmtest02",接下来
curPage.WebEdit(Password_desc).Set "password"
curPage.image("name:=続ける").Click
都会报错“Cannot identify the object "[ WebEdit ]" (of class WebEdit). Verify that this object's properties match an object currently displayed in your application” 从报错的提示信息看,就是测试对象找不到,或者要操作的测试对象没有激活,比如测试对象状态是disable的,或者测试对象的位置在屏幕可视范围之外。具体怎么发生的需要看你的界面。这种问题你最好配个图上来,不然别人不知道那个界面是如何处理用户操作的。 curPage.Sync
页面都被关闭了,怎么可能找到的webedit呢 用WebElement代替WebEdit试试。。首先要确定的是你对WebEdit的定义是否准确。
唉,只好spy一下看看了,或者就录制嘛。多么简单。 另外3#的, .sync方法相当于激活当前浏览器,而不是关闭。
页:
[1]