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