在这次的修改方案中,还有一点比较重要的是我将窗体的管理使用一个单独的类来处理,由于窗体是所有控件的容器所以处理起来比较特殊,因此不便于跟其他控件一起处理,并且窗体的产生都是在操作控件之前的。我将窗体管理类命名为:WinManager 它主要完成如下工作:
/// <summary>
/// singleton pattern
/// this class can do the jobs
/// 1) Collect the opened window of the application
/// 2) Remove the all of window of the application
/// 3) Get the window by FormAttribute
/// </summary>
并且在这次的修改方案中对整个测试脚本的xml文件格式也进行了比较大的修改,主要是原先的脚本内容和字段命名多比较的含糊。
对Controls.xml文件也进行了规范化, 让它只支持三个字段的访问,automationId, className和name