Use the Print Utility statement in your test to display information in the QuickTest Print Log window while still continuing the run session. For example, the following example iterates all the items in the Flight Table dialog (in the sample Flight application) and uses the Print Utility statement to print the content of each item to the QuickTest Print Log window.
Set FlightsList = Window("Flight Reservation").Dialog("Flights Table").WinList("From")
For i = 1 to FlightsList.GetItemsCount
Print FlightsList.GetItem(i - 1)
Next
The QuickTest Print Log window remains open throughout the run session, until you close it.
[attach]44527[/attach]作者: hblxp321 时间: 2010-2-24 14:41 标题: 放置print代码的位置是关键,要保证被测试窗口未关闭 Dialog("Login").WinEdit("Agent Name:").Set "mercury"
Dialog("Login").WinEdit("Password:").SetSecure "4b84c75060c89e9f0312c66f4e3fa6c7fcceaf3f"
Dialog("Login").WinButton("OK").Click
Window("Flight Reservation").ActiveX("MaskEdBox").Type "121212"
Window("Flight Reservation").WinComboBox("Fly From:").Select "Frankfurt"
Window("Flight Reservation").WinComboBox("Fly To:").Select "London"
Window("Flight Reservation").WinButton("FLIGHT").Click
Window("Flight Reservation").Dialog("Flights Table").WinList("From").Select "13508 FRA 10:24 AM LON 11:09 AM SR $160.20"
Set FlightsList = window("Flight Reservation").Dialog("Flights Table").WinList("From")
For i = 1 to FlightsList.GetItemsCount
'Print FlightsList.GetItem(i-1)
Next
print的代码要放置在你航班选择窗口未关闭的位置,明白了吗作者: 风雪夜归人 时间: 2010-2-24 15:19
大家关注的地方错了吧?QTP8.2里面貌似没有print这个函数的作者: YangMay 时间: 2010-3-8 11:23 标题: QTP现成帮助文档.Share QuickTest Professional Object Model Reference
Print Statement
Description
Displays information in the QuickTest Print Log window during the run session. The QuickTest Print Log window remains open while the run session continues, until you close it.
For more information, refer to the QuickTest Professional User's Guide.
Syntax
Print (Message)
Argument
Type
Description
Message String String expression displayed as the message in the QuickTest Print Log window.
Example
The following example iterates all the items in the Flight Table dialog (in the sample Flight application) and uses the Print utility statment to print the content of each item to the QuickTest Print Log window.
Set FlightsList = Window("Flight Reservation").Dialog("Flights Table").WinList("From")