TA的每日心情 | 开心 2015-5-4 14:23 |
---|
签到天数: 1 天 连续签到: 1 天 [LV.1]测试小兵
|
Dim objParent, strName, strPassword
strName = "admin"
strPassword="admin"
Set objParent = Browser("title:=网站后台管理系统").Page("title:=网站后台管理系统")
objParent.WebEdit("name:=登录名:").Set strName
objParent.WebEdit("name:=密 码:").Set strPassword
objParent.WebButton("text:=登 录").Click
Dim res,cmd,sql
Set Res=createobject("adodb.recordset")
Set Cmd=createobject("adodb.command")
Cmd.activeconnection="Provider = Sqloledb; User ID = sa; Password = sa; Initial Catalog =bb; Data Source = 192.168.2.196 "
Cmd.CommandType = 1
sql="select * from admin_user where name=" & strName
Cmd.CommandText = sql
Set res = Cmd.Execute()
Set res = nothing
Set cmd.ActiveConnection = nothing
Set Cmd= nothing
objParent.sync()
执行后,QuickTest提示
Cannot identify the object "WebEdit" (of class WebEdit). Verify that this object's properties match an object currently displayed in your application.
黄色小箭头指向 objParent.WebEdit("name:=登录名:").Set strName |
|