ip008 发表于 2009-12-14 15:25:10

QTP脚本自动结束了

测一个FLEX的网站,进入一个Tab以后要填写好几个TextBox
但是QTP在填了一个以后就自动结束并且弹出报告了。很费解。
代码贴出来给大家研究下。
wait(15)
'Browser("Browser").FlexApplication("main").FlexPanel("CL Specialty - Marine").FlexBox("index:22").FlexBox("autoRating").FlexForm("autogeneralInfor").FlexTextArea("Annual Base Rate ::autoBaseRat").SelectText 0,0
Browser("Browser").FlexApplication("main").FlexPanel("CL Specialty - Marine").FlexBox("index:22").FlexBox("autoRating").FlexForm("autogeneralInfor").FlexTextArea("Annual Base Rate ::autoBaseRat").Input AnnualBaseRate
Browser("Browser").FlexApplication("main").FlexPanel("CL Specialty - Marine").FlexBox("index:22").FlexBox("autoRating").FlexBox("baseRating").Scroll 296,flexScrollVertical,flexThumbPosition
'Browser("Browser").FlexApplication("main").FlexPanel("CL Specialty - Marine").FlexBox("index:22").FlexBox("autoRating").FlexTextArea("autoti").SelectText 0,0
Browser("Browser").FlexApplication("main").FlexPanel("CL Specialty - Marine").FlexBox("index:22").FlexBox("autoRating").FlexTextArea("autoti").Input LE
'Browser("Browser").FlexApplication("main").FlexPanel("CL Specialty - Marine").FlexBox("index:22").FlexBox("autoRating").FlexTextArea("autoti_2").SelectText 0,0
Browser("Browser").FlexApplication("main").FlexPanel("CL Specialty - Marine").FlexBox("index:22").FlexBox("autoRating").FlexTextArea("autoti_2").Input         DT               
'Browser("Browser").FlexApplication("main").FlexPanel("CL Specialty - Marine").FlexBox("index:22").FlexBox("autoRating").FlexTextArea("autoti_3").SelectText 0,0
Browser("Browser").FlexApplication("main").FlexPanel("CL Specialty - Marine").FlexBox("index:22").FlexBox("autoRating").FlexTextArea("autoti_3").Input DR
'Browser("Browser").FlexApplication("main").FlexPanel("CL Specialty - Marine").FlexBox("index:22").FlexBox("autoRating").FlexTextArea("autoti_4").SelectText 0,0
Browser("Browser").FlexApplication("main").FlexPanel("CL Specialty - Marine").FlexBox("index:22").FlexBox("autoRating").FlexTextArea("autoti_4").Input AO
'Browser("Browser").FlexApplication("main").FlexPanel("CL Specialty - Marine").FlexBox("index:22").FlexBox("autoRating").FlexTextArea("autoTheftVmmLoadRateFctr").SelectText 0,0
Browser("Browser").FlexApplication("main").FlexPanel("CL Specialty - Marine").FlexBox("index:22").FlexBox("autoRating").FlexTextArea("autoTheftVmmLoadRateFctr").Input TVL
'Browser("Browser").FlexApplication("main").FlexPanel("CL Specialty - Marine").FlexBox("index:22").FlexBox("autoRating").FlexTextArea("autoTrnstLoadRateFctr").SelectText 0,0
Browser("Browser").FlexApplication("main").FlexPanel("CL Specialty - Marine").FlexBox("index:22").FlexBox("autoRating").FlexTextArea("autoTrnstLoadRateFctr").Input TL
Browser("Browser").FlexApplication("main").FlexPanel("CL Specialty - Marine").FlexBox("index:22").FlexBox("autoRating").FlexBox("baseRating").Scroll 555,flexScrollVertical,flexThumbPosition
'Browser("Browser").FlexApplication("main").FlexPanel("CL Specialty - Marine").FlexBox("index:22").FlexBox("autoRating").FlexTextArea("autoBaseRateFloodAnnlLoadFctr").SelectText 0,0
Browser("Browser").FlexApplication("main").FlexPanel("CL Specialty - Marine").FlexBox("index:22").FlexBox("autoRating").FlexTextArea("autoBaseRateFloodAnnlLoadFctr").Input FL
'Browser("Browser").FlexApplication("main").FlexPanel("CL Specialty - Marine").FlexBox("index:22").FlexBox("autoRating").FlexTextArea("autoBaseRateEarthqkAnnlLoadFct").SelectText 0,0
Browser("Browser").FlexApplication("main").FlexPanel("CL Specialty - Marine").FlexBox("index:22").FlexBox("autoRating").FlexTextArea("autoBaseRateEarthqkAnnlLoadFct").Input EL
Browser("Browser").FlexApplication("main").FlexPanel("CL Specialty - Marine").FlexBox("index:22").FlexBox("autoRating").FlexButton("Rate").Click

'AP = Browser("Browser").FlexApplication("main").FlexPanel("CL Specialty - Marine").FlexBox("index:22").FlexBox("autoRating").FlexLabel("Quarterly").GetROProperty("text")
RR = Browser("Browser").FlexApplication("main").FlexPanel("CL Specialty - Marine").FlexBox("index:22").FlexBox("autoRating").FlexLabel("0.500").GetROProperty("text")
'Browser("Browser").FlexApplication("main").FlexPanel("CL Specialty - Marine").FlexBox("index:22").FlexBox("autoRating").FlexLabel("FOL").GetROProperty("text")
'Browser("Browser").FlexApplication("main").FlexPanel("CL Specialty - Marine").FlexBox("index:22").FlexBox("autoRating").FlexLabel("QCL").GetROProperty("text")

Browser("Browser").FlexApplication("main").FlexPanel("CL Specialty - Marine").FlexBox("index:22").FlexBox("autoRating").FlexBox("baseRating").Scroll 760,flexScrollVertical,flexThumbPosition
Browser("Browser").FlexApplication("main").FlexPanel("CL Specialty - Marine").FlexBox("index:22").FlexBox("autoRating").FlexButton("Show Final Rates").Click



DP = Browser("Browser").FlexApplication("main").FlexPanel("CL Specialty - Marine").FlexBox("index:22").FlexBox("autoRating").FlexLabel("autoRptDpostPremAmt").GetROProperty ("text")
TTP = Browser("Browser").FlexApplication("main").FlexPanel("CL Specialty - Marine").FlexBox("index:22").FlexBox("autoRating").FlexLabel("autoTotlTerrsmAnnlPremAmtActua").GetROProperty("text")
SS = Browser("Browser").FlexApplication("main").FlexPanel("CL Specialty - Marine").FlexBox("index:22").FlexBox("autoRating").FlexLabel("autoAnnlSurchrgAmtactualValueD").GetROProperty("text")
'Browser("Browser").FlexApplication("main").FlexPanel("CL Specialty - Marine").FlexBox("index:22").FlexBox("autoRating").FlexLabel("autoSingleBaseRateAnnlRateFctr").GetROProperty ("text")
ACR = Browser("Browser").FlexApplication("main").FlexPanel("CL Specialty - Marine").FlexBox("index:22").FlexBox("autoRating").FlexLabel("autoAddtnCovgAvgBaseRateFctrAc").GetROProperty("text")
TPA = Browser("Browser").FlexApplication("main").FlexPanel("CL Specialty - Marine").FlexBox("index:22").FlexBox("autoRating").FlexLabel("autoTotlExclEqpmtBrkdnSurchrgT").GetROProperty("text")
TPD = Browser("Browser").FlexApplication("main").FlexPanel("CL Specialty - Marine").FlexBox("index:22").FlexBox("autoRating").FlexLabel("autoTotlExclEqpmtBrkdnSurchrgT_2").GetROProperty( "text")



DataTable.Value("RR",dtLocalSheet) = RR
DataTable.Value("DP",dtLocalSheet) = DP
DataTable.Value("TTP",dtLocalSheet) = TTP
DataTable.Value("SS",dtLocalSheet) = SS
DataTable.Value("ACR",dtLocalSheet) = ACR
DataTable.Value("TPA",dtLocalSheet) = TPA
DataTable.Value("TPD",dtLocalSheet) = TPD



Browser("Browser").Refresh
Browser("Browser").Sync

运行到红色的位置就会自动结束

ip008 发表于 2009-12-14 16:54:13

:)

ip008 发表于 2009-12-14 17:05:05

顺便说一下,单步调试没有这个问题。

ip008 发表于 2009-12-15 15:32:54

:) :)

ty406 发表于 2009-12-16 16:47:04

是不是系统没来得及识别呢?你加个wait(3)等等看

ip008 发表于 2009-12-17 14:15:03

好的,我试试,我发现QTP测Flex的时候识别控件非常的慢,都要几十秒,还没手动操作快。
页: [1]
查看完整版本: QTP脚本自动结束了