• <ruby id="5koa6"></ruby>
    <ruby id="5koa6"><option id="5koa6"><thead id="5koa6"></thead></option></ruby>

    <progress id="5koa6"></progress>

  • <strong id="5koa6"></strong>
    • 軟件測試技術
    • 軟件測試博客
    • 軟件測試視頻
    • 開源軟件測試技術
    • 軟件測試論壇
    • 軟件測試沙龍
    • 軟件測試資料下載
    • 軟件測試雜志
    • 軟件測試人才招聘
      暫時沒有公告

    字號: | 推薦給好友 上一篇 | 下一篇

    用Rational Functional Tester創建隨需應變的自動測試腳本

    發布: 2008-6-18 10:47 | 作者: 不詳 | 來源: ibm | 查看: 253次 | 進入軟件測試論壇討論

    領測軟件測試網

    我們仍然以這個場景為例,所不同的是:用戶進入IBM中國網站。再搜索關鍵字"lotus",驗證"www.lotus.com"這一鏈接存在于結果集內。測試過程的邏輯并沒有變化,但界面截然不同, "Search"按鈕在這里顯示為"搜索"按鈕。


    為了拓展腳本SearchLotusLink對多語言的支持能力,我們在SearchLotusLinkHelper查找對象的過程中,加上一個中間層,通過它來銜接固定的操作邏輯和多變的界面。原先的方法findTestObjectInBrowser(String property1, String value1, String property2, String value2)只是按這兩個屬性值找出合適的對象;現在則要對屬性做適當的轉換,使它能適應其他語言環境,在不同語言的界面里都能定位到這個頁面對象。

    將Rational Functional Tester切換到"Java透視圖",在SearchLotusLinkHelper所在的resources包中,添加一個類:utilities,來實現對多語言環境的支持。這里為簡單起見,我們將URL和搜索按鈕的文本的多語言表示直接保存在這個類里。用戶可以通過它來獲取某一屬性在特定語言環境下的表示。

     


    public class utilities {
     /**
      * Script Name   : <b>utilities</b>
      * Generated     : <b>2005-10-25 16:51:51</b>
      * Description   : Functional Test Script
      * Original Host : WinNT Version 5.1  Build 2600 (S)
      *
      * @since  2005/10/25
      * @author zhangguojun
      */
     public static String EN_LOCALE = "en";
     public static String CN_LOCALE = "cn"; 
     public String CurrentLocale = EN_LOCALE; 
     private  Hashtable textRepositoryForEN = new Hashtable();
     private  Hashtable textRepositoryForCN = new Hashtable();
     private static utilities _instance = null;
     
     private  utilities(){
      textRepositoryForEN.put("Search","Search");
      textRepositoryForEN.put("IBMurl","www.ibm.com");  
      textRepositoryForCN.put("Search","搜索");
      textRepositoryForCN.put("IBMurl","www.ibm.com/cn");
     } 
     public static utilities getInstance() {
      if (null == _instance)
       _instance = new utilities();
      return _instance;
     } 
     public void setCurrentLocale(String locale)
     {
      CurrentLocale=locale;
     } 
     public String getLocalText(String textId)
     {
      return getLocalText(CurrentLocale,textId);
     } 
     public String getLocalText(String locale, String textId)
     {
      String returnVal = null;
      if(locale.equals(EN_LOCALE))
       returnVal = (String)textRepositoryForEN.get(textId);
      else if(locale.equals(CN_LOCALE))
       returnVal = (String)textRepositoryForCN.get(textId);
      if(null==returnVal)
       return textId;
      else
       return returnVal;
     }
    }
     

    文章來源于領測軟件測試網 http://www.kjueaiud.com/


    關于領測軟件測試網 | 領測軟件測試網合作伙伴 | 廣告服務 | 投稿指南 | 聯系我們 | 網站地圖 | 友情鏈接
    版權所有(C) 2003-2010 TestAge(領測軟件測試網)|領測國際科技(北京)有限公司|軟件測試工程師培訓網 All Rights Reserved
    北京市海淀區中關村南大街9號北京理工科技大廈1402室 京ICP備10010545號-5
    技術支持和業務聯系:info@testage.com.cn 電話:010-51297073

    軟件測試 | 領測國際ISTQBISTQB官網TMMiTMMi認證國際軟件測試工程師認證領測軟件測試網

    老湿亚洲永久精品ww47香蕉图片_日韩欧美中文字幕北美法律_国产AV永久无码天堂影院_久久婷婷综合色丁香五月

  • <ruby id="5koa6"></ruby>
    <ruby id="5koa6"><option id="5koa6"><thead id="5koa6"></thead></option></ruby>

    <progress id="5koa6"></progress>

  • <strong id="5koa6"></strong>