|
使用qtp做一个登陆VBS脚本:
test:
login “name”,"123"
VBS:
Function login(user,password)
ret = OpenWeb("http://186.sgamer.com")
If ret <>0 Then
ReportResult 1,"login","path is not exist!"
login =false
Exit function
End If
If isnull(user) then
ReportResult 1,"login","user is not null!"
login =false
Exit function
End if
If isnull(password) Then
ReportResult 1,"login","password is not null!"
login =false
Exit function
End If
Browser("用户登录").Page("用户登录").WebEdit("WebEdit").Set user
Browser("用户登录").Page("用户登录").WebEdit("WebEdit_2").Set password
Browser("用户登录").Page("用户登录").WebArea("登陆").Click |
|