|
请哪位高手帮我看一下这段代码,哪里写的有问题,在运行的日志里显示“Unexpected Active Window”的警告,我逐行调试,是“ window setcontext, "caption=提示","" ”出的问题,请问该怎样修改呢?
'$include "sqautil.sbh"
Sub Main
Dim Result As Integer
dim x as integer
dim strid as string
dim strpsw as string
dim dp as long
'Initially Recorded: 2007-5-16 10:56:15
'Script Name: 登录
StartApplication "xx.exe"
dp=SQADatapoolOpen("登录")
for x=1 to 4
Call SQADatapoolFetch(dp)
Call SQADatapoolValue(dp,1,strid)
Call SQADatapoolValue(dp,2,strpsw)
Window SetContext, "Type=Form;Name=LoginFrm", ""
EditBox DblClick, "Type=EditBox;Name=txt_userid;State=Hidden", "Coords=54,9"
InputKeys strid
EditBox DblClick, "Type=EditBox;Name=txt_psw;State=Hidden", "Coords=55,7"
InputKeys strpsw &"{ENTER}"
window setcontext, "caption=提示",""
Result = WindowVP (Exists, "caption=提示", "VP=Window Existence;wait=2,3;expectedresult=fail")
if result=0 then
inputkeys "{enter}"
end if
if result=1 then
Window SetContext, "Type=Form;Name=MDIMain", ""
end if
next
call sqadatapoolclose(dp)
Window CloseWin, "", ""
End Sub
[ 本帖最后由 zhenqi 于 2007-5-16 16:16 编辑 ] |
|