|
录制了一个login功能,循环时,总是在鼠标定位的地方卡住,运行不了。把鼠标定位方式改为键盘快捷方式,就可以正常运行了。但是脚本中红色的部分仍然不能通过。
请问这是什么原因?
以下是我的脚本:
'$Include "sqautil.sbh"
Sub Main
Dim Result As Integer
Dim pool As Long
Dim pool_result As long
Dim ac as String
Dim pwd as String
Dim frame as String
Dim count as Long
Dim num as Long
'Initially Recorded: 2006-4-4 9:38:19
'Script Name: login_alert_1
pool=SQADatapoolOpen("test",FALSE,SQA_DP_SEQUENTIAL,FALSE)
pool_result=SQADatapoolFetch(pool)
Window SetContext, "Class=Shell_TrayWnd", ""
StartBrowser "http://192.168.0.128:9080/kent", "WindowTag=WEBBrowser"
num=0
frame="Type=HTMLFrame;HTMLId=mainFrame"
while pool_result<>sqaDpEOF
count=1
num=num+1
pool_result=SQADatapoolValue(pool,1,ac)
pool_result=SQADatapoolValue(pool,2,pwd)
while count<num
frame=frame+"\;Type=HTMLFrame;HTMLId=mainFrame"
count=count+1
wend
Window SetContext, "WindowTag=WEBBrowser", ""
'Browser SetFrame,frame,""
'Browser NewPage,"HTMLTitle=K.I.X login",""
'EditBox Click, "Type=EditBox;Name=ACTOR_NAME", "Coords=29,18"
'InputKeys ac
'EditBox Click, "Type=EditBox;Name=PASSWORD", "Coords=23,18"
' EditBox Click, "Type=EditBox;Name=ACTOR_CODE", "Coords=29,13"
InputKeys ac+"{TAB}"+pwd+"{ENTER}"
Browser SetFrame,frame,""
'EditBox Click, "Type=EditBox;Name=PASSWORD", "Coords=23,13"
'InputKeys pwd
'PushButton Click, "Type=PushButton;HTMLText=login"
Browser NewPage,"HTMLTitle=kent system",""
HTMLImage Click, "Type=HTMLImage;Name=GoShowReply4", "Coords=47,13" pool_result=SQADatapoolFetch(pool)
wend
pool_result=SQADatapoolClose(pool)
End Sub
[ 本帖最后由 wonder80 于 2006-4-19 15:04 编辑 ] |
|