xue202757 发表于 2010-7-16 18:52:15

读不出DataTable中的数据。

Dim User_ID_Path, S_Password

User_ID_Path = DataTable.GetSheet("Global").GetParameter("User_ID_Path").ValueByRow(1)
S_Password = DataTable.GetSheet("Global").GetParameter("Password").ValueByRow(1)

Window("IBM Lotus Notes").Activate
Window("IBM Lotus Notes").Dialog("Lotus Notes").Activate
Window("IBM Lotus Notes").Dialog("Lotus Notes").WinButton("Cancel").Click
Window("IBM Lotus Notes").Dialog("Unsuccessful Notes Login").WinRadioButton("Switch to a different").Set
Window("IBM Lotus Notes").Dialog("Unsuccessful Notes Login").WinButton("OK").Click
Window("IBM Lotus Notes").Dialog("Choose User ID to Switch").WinEdit("File name:").Type User_ID_path
Window("IBM Lotus Notes").Dialog("Choose User ID to Switch").WinButton("Open").Click

Window("IBM Lotus Notes").Dialog("Lotus Notes").WinObject("Enter your password").Type S_Password

Window("IBM Lotus Notes").Dialog("Lotus Notes").WinObject("Enter your password").TypemicReturn

上面的代码在QTP单机环境下能运行正常,但当我建了一个script component到QC上,用的是同样的代码,且在DataTable中用的也是一一模一样的数据。当在QC的 Test Lab中运行时,print出来的User_ID_Path和S_Password都是空的。(Test Lab中运行的这个Test Set是由两个script component组成的,这是第二个,第一个就是用SystemUtil.Run打开测试程序。)

请大家分析一下原因。谢谢

xue202757 发表于 2010-7-19 10:14:00

请大家帮忙分析一下,是不是这种方式下就不能用Datatable来实现参数化。
页: [1]
查看完整版本: 读不出DataTable中的数据。