|
录制了一脚本,在一个页面中点击一按钮,进入下一个页面。
然后修改这个脚本,加入一判断:使用SQAFindObject查找该页面是否有对应按钮,有则点击,没有则结束。
但是,SQAFindObject总是返回1003。这是为什么?
代码如下:红色部分是我添加的判断
Sub Main
Dim Result As Integer
'Initially Recorded: 2006-4-6 17:13:25
'Script Name: test_temp
Window SetContext, "Class=Shell_TrayWnd", ""
Toolbar Click, "Text=运行应用程序;\;ItemID=1", "Coords=21,23"
StartBrowser "http://192.168.0.128:9080/kent", "WindowTag=WEBBrowser"
delayfor 1000
Window SetContext, "WindowTag=WEBBrowser", ""
InputKeys "liaq{ENTER}"
Browser SetFrame,"Type=HTMLFrame;HTMLId=mainFrame",""
Browser NewPage,"HTMLTitle=kent system",""
ComboBox Click, "Type=ComboBox;Name=ACTOR_ID", ""
ComboListBox Click, "Type=ComboListBox;Name=ACTOR_ID", "Text=lianqi"
delayfor 1000
Result=SQAFindObject("Type=PushButton;Name=Submit1")
if(Result=sqaObjectNotFound) then
SQALogMessage sqaFail,"does not find the object",""
else PushButton Click, "Type=PushButton;Name=Submit1"
end if
InputKeys "%{F4}"
End Sub
请各位帮忙看看! |
|