TA的每日心情 | 开心 2015-5-4 14:23 |
---|
签到天数: 1 天 连续签到: 1 天 [LV.1]测试小兵
|
xiaonan,你说的加单引好的方法我也试过了,可就是下不去,QuickTest报错,提示如下:
第 1 行: '*' 附近有语法错误。还是在Set res = Cmd.Execute()这里卡助了
michaelyung ,你的方法我用了,脚本如下:
Dim objParent, strName, strPassword
strName = "admin"
strPassword="admin"
Set objParent = Browser("title:=网站后台管理系统").Page("title:=网站后台管理系统")
objParent.WebEdit("text:=username").Set strName
objParent.WebEdit("text:=password").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.5.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("text:=username").Set strName 这句 |
|