|
本帖最后由 FLY000 于 2010-12-20 18:37 编辑
下面的代码是写在TEST的ACTION1中,函数写在VBS文件中加载进来,点击RUN按钮运行的时候,有的功能会重复运行,有的功能会漏掉,但是如果单步运行调试,又没有这些现象;
不知道大家有没有碰到过这种情况。
附件是函数VBS文件
If Window("Tomcat").Exist(1) Then
Window("Tomcat").Close
wait(10)
End If
SystemUtil.Run "E:\WTAP\ImportData\init.bat"
wait(250)
SystemUtil.Run "startup.bat","","E:\apache-tomcat-wtap\bin\","open"
wait(60)
SystemUtil.Run "C:\Program Files\Internet Explorer\iexplore.exe","http://192.168.1.98:8085/wtap/","open"
Executefile "E:\WTAP\Function\sub.vbs"
wait(10)
Call Login("0000000","123456")
Call ExpandItem("税收快报")
Call ClickItem("2009年税收电月报")
Call ClickLink("任务属性")
Call SetTaskProPertyBbq()
Call Logout()
Call Login("1010000","123456")
Call ExpandItem("系统管理")
Call ClickItem("税务机关与账号管理")
Call SelectOrganize("1010000","北京市国税局")
Call AddUser("bjkb","北京快报",1)
Call SelectOrganize("1010000","北京市国税局")
Call AddOrganize("1010001","东城分局",0)
Call SelectOrganize("1010001","东城分局")
Call AddUser("dckb","东城快报",1)
Call SelectOrganize("1010000","北京市国税局")
Call AddOrganize("1010002","西城分局",0)
Call Logout()
Call Login("bjkb","")
Call ExpandItem("税收快报")
Call ClickItem("2009年税收电月报")
Call ClickLink("分发任务")
Call DistributeTask("","")
Call LogOut()
Call Login("dckb","")
Call ExpandItem("税收快报")
Call ClickItem("2009年税收电月报")
Call ClickLink("数据管理")
Call ImportData("E:\WTAP\ImportData\DB10091010001.TXT")
Call LogOut()
Call Login("bjkb","")
Call ExpandItem("税收快报")
Call ClickItem("2009年税收电月报")
Call ClickLink("数据管理")
Call ClickBbqPanel()
cBbq = GetBbq("DB10091010001.TXT")
Call SelectBbq(cBbq)
Call CaculateAllBbh()
Call CollectData()
Call DetailAudit()
Call ReportAuditStatistic()
Call LogOut()
Call Login("1010000","123456")
Call ExpandItem("税收快报")
Call ExpandItem("2009年税收电月报")
Call RightClick("我的分析表")
Call SelectRightMenu("导入分析对象")
Call ImportFile("E:\WTAP\ImportData\dbtest.zip")===这个功能是导入分析表
Call ExpandItem("我的分析表")
Call RightClick("测试表 test")
Call SelectRightMenu("计算")
Call CaculateReport("市级","DB10091010001.TXT")===运行到这个功能的时候,分析表又被导入了一遍
Call LogOut()
Call Login("0000000","123456")
Call ExpandItem("系统管理")
Call ClickItem("税务机关与账号管理")
Call ExpandOrganize("2000000","地税")
Call SelectOrganize("2210000","湖北省地税局")
Call AddUser("hbkt","湖北地税",3)
Call SelectOrganize("2210000","湖北省地税局")
Call AddOrganize("2210100","武汉地税局",9)
Call SelectOrganize("2210100","武汉地税局")
Call AddUser("whkt","武汉地税",3)
Call SelectOrganize("2210100","武汉地税局")===这四句没有运行,直接运行到下面的功能了,导致脚本运行失败
Call AddOrganize("2210101","江岸区",0)
Call SelectOrganize("2210101","江岸区")
Call AddUser("jakt","江岸区",3)
Call Logout()
Call Login("zjkt","zjkt")
Call ExpandItem("会统月报")
Call ClickItem("2010年会统月报")
Call ClickLink("分发任务")
Call DistributeTask("","")
Call LogOut()
Call Login("hbkt","")
Call ExpandItem("会统月报")
Call RightClick("2010年会统月报")
Call SelectRightMenu("复制并编辑任务")
Call CopyAndEditTask()
Call ClickItem("2010年会统月报")
Call ClickLink("任务属性")
Call SetTaskProPertyBbq()
Call LogOut()
Call Login("whkt","")
Call ExpandItem("会统月报")
Call ClickItem("2010年会统月报\(湖北省地税局\)")
Call ClickLink("分发任务")
Call DistributeTask("1;2","2")
Call LogOut()
Call Login("jakt","")
Call ExpandItem("会统月报")
Call ClickItem("2010年会统月报\(湖北省地税局\)")
Call ClickLink("数据管理")
Call BaseLayerReportData()
Call LogOut()
Call Login("whkt","")
Call ExpandItem("会统月报")
Call ClickItem("2010年会统月报\(湖北省地税局\)")
Call ClickLink("数据管理")
Call CollectData()
Call ViewBbhData("\*2210100")
Call CollectReportData()
Call TruncateBalance()
Call LogOut()
Call Login("hbkt","")
Call ExpandItem("会统月报")
Call ClickItem("2010年会统月报\(湖北省地税局\)")
Call ClickLink("数据管理")
Call CollectData()
Call CaculateAllBbh()
Call DetailAudit()
Call ReportAuditStatistic()
Call ExpandNavigate()
Call ClickItem("2010年会统月报\(湖北省地税局\)")
Call ClickLink("数据管理")
Call DefineTaskRelation("2010年会统月报")
Call ExpandNavigate()
Call ClickItem("2010年会统月报\(湖北省地税局\)")
Call ClickLink("报表户管理")
Call FetchBbh("2010年会统月报(湖北省地税局)","主数据集(万元)","2010年","11月")
Call ExpandNavigate()
Call ClickItem("2010年会统月报\(湖北省地税局\)")
Call ClickLink("数据管理")
Call DataRSS("2010年会统月报")
Call LogOut() |
|