概述:
本系列文章主要用來研究和分析QTP自動的例子的源碼分析,學習它的編碼方式和代碼結構,
所涉及的Action 分三部分
1.共用的Action
2.功能性Action,它們一般會調用共用的Action
3.功能性函數
Action:FlightLib1
下面是ClearMainWindow的具體分析(作用和好處,以免在運作的時候,之前的那個視窗是開着的,導緻回訪的時候出錯,這樣代碼的健壯性比較好)
Purpose:This Action clears the main window and Does not save any information in the window
Input Params:None
Output Params:None
代碼8~9行,如果Open Order界面已經是開着的,點選cancel将其關閉
代碼12~16行,通過點選new order,清除之前可能有輸入的記錄
代碼18~22行,Checking to see if message window appears. If so, function presses "No" button and doesn't save the changes(如圖裡的錯誤資訊)
<a href="http://blog.51cto.com/attachment/201311/111427535.jpg"></a>
<a href="http://blog.51cto.com/attachment/201311/110616226.jpg"></a>
本文轉自 jasonteststudy 51CTO部落格,原文連結:http://blog.51cto.com/jasonteststudy/1330644