Mandy_ma 2007-7-16 12:07
求助:用录制的Testcase下载文件遇到的问题
已经开始下载了,但是还没有下载完的时候就Closing DialogBox。
不想关闭下载,怎么修改脚本呢?
[-] testcase Test3 ()
[-] recording
[ ] Browser.Location.SetText ("http://www.microsoft.com/downloads/thankyou.aspx?familyId=2d83efce-e507-4aff-ab9b-eaf1d0d6320d&displayLang=zh-cn")
[ ] Browser.Location.TypeKeys ("<Enter>")
[ ] 下载详细信息InternetExplorer501.SetActive( )
[ ] 下载详细信息InternetExplorer501.对话框中执行以下操作之一.开始下载.Click ()
[ ] 文件下载安全警告.SetActive ()
[ ] 文件下载安全警告.保存S.Click ()
[ ] 另存为.SetActive ()
[ ] 另存为.桌面.Click ()
[ ] 另存为.保存S.Click ()
jmy_1981 2007-7-16 17:20
用IE改吧,用Silk改要加窗口判断的。
/* 参考答案 */
可以试试到 IE | Tools | Internet Options | >> [Advance] tab >> 在 [Browsing] 下把 "Notify when downloads complete" 勾上。
如果一定要用Silk写,你就要先写预判(if !XXX_dialogBox.Exist () ...),还要给出时钟,比较麻烦。
谢谢。
Mandy_ma 2007-7-17 14:30
已经选上了啊
每次下载的时间也不一样,设置时钟大小不好确定啊sdlkfj9
Mandy_ma 2007-7-17 17:43
[-] //define OnLoadPage within the window declaration for BorlandMain
[ ] //the declaration must contain the member sUrl , as required by LoadPage
[-] window BrowserChild MicrosoftMain
[ ] String sURL0="http://support.microsoft.com/default.aspx?scid=kb;zh-cn;"
[ ] String sPathID="928090"
[ ] String sURL=sURL0 + sPathID
[ ]
[ ] // printf ("{sURL}"+"{sPathID}")
[ ]
[ ] //define your own OnLoadPage
[-] OnLoadPage (STRING sLocation, STRING sUserName null, STRING sPassword null)
[-] recording
[-] withoptions
[ ] BindAgentOption (OPT_VERIFY_APPREADY, FALSE)
[ ] BindAgentOption (OPT_PLAY_MODE, "Win32")
[ ]
[ ] // Browser.Stop.Click ()
[-] // if (BrowserPage.JavaApplet("#1").Exists (2))
[ ] // print ("movie exists")
[ ] // RECT BrowserRect = BrowserPage.GetRect ()
[ ] // //click window to dismiss it
[ ] // BrowserPage.PressMouse (1, BrowserRect.xSize / 2, BrowserRect.ySize/ 2)
[ ] // sleep (.1)
[ ] // BrowserPage.ReleaseMouse (1, BrowserRect.xSize / 2, BrowserRect.ySize / 2)
[ ] //then call Borland's OnLoadPage
[ ]
[ ] Browser.OnLoadPage (sLocation, sUserName, sPassword)
[ ] print ("{sURL}")
[ ] //load the main browser window
[-] main ( )
[ ] Browser.Invoke ()
[ ] Browser.LoadPage (MicrosoftMain)
上面的脚本可以实现打开相应的连接,但是还没有找到继续的方法实现前面下载的功能。
[[i] 本帖最后由 Mandy_ma 于 2007-7-17 17:45 编辑 [/i]]