不谋万世者,不足谋一时;不谋全局者,不足谋一域。君子敏于事而慎于言 新浪微薄:土司阿哈

使用QTP环境变量

上一篇 / 下一篇  2008-11-14 15:28:09 / 个人分类:qtp

1208328177
  • 自动化测试:
  • 测试文档:
51Testing软件测试网1D'q0_["_

Dim Excel,Workbook,WorkSheet,run_value,scrīpt_name
tT*F F,E*?:pA1iLI0Dim filepath,bnpFileName51Testing软件测试网Ou"G:Ev2P MV%t

IG0~J,G%E0Environment.Value("file_pash") = "C:\Documents and Settings\robel.yi\Desktop\BNP_scrīptS"
)uG^am qBR051Testing软件测试网!| J7_a/Y9x
filepath=environment("file_pash")51Testing软件测试网*]0\S _Z;E
bnpFileName=filepath & "\Data_file\Main_DATA.xml"
"N'B @7U"U051Testing软件测试网1aJ k,@)X^ w
Set Excel= CreateObject("Excel.Application")
&S t7qh"v\R)K+Au j&E0Set Workbook= Excel.Workbooks.Open(bnpFileName)51Testing软件测试网9a:l.rst
Set WorkSheet= workbook.Worksheets("Sheet1")51Testing软件测试网!Q%L7Y0WC-^5A7d
51Testing软件测试网o+Wm p"Y az k
For i = 2 To 651Testing软件测试网4f1TM1Z"VlAhj
        run_value=CStr(WorkSheet.Cells(i, 3))51Testing软件测试网cfgq:oG7Z
        If run_value = "Y" Then
%i{-cz,n {0                RunAction CStr(WorkSheet.Cells(i, 2))
D"Z*W&y(WO0        End If51Testing软件测试网+qI`,C;y[0^\3e;k W!Y
Next
f S G)FM051Testing软件测试网,k3iY{6I@d d
Excel.Quit51Testing软件测试网&Nz6M,j'@
Set Workbook = nothing51Testing软件测试网x'MFhx5|@$R9u
Set WorkSheet = nothing51Testing软件测试网u'ZKg-C G/e:k0`u

GJ:nv$` U0_Y'a0转载51testing http://bbs.51testing.com/viewthread.php?tid=131075

u8G6x3rg0

TAG: QTP qtp

 

评分:0

我来说两句

Open Toolbar