您的位置:軟件測試 > 開源軟件測試 > 開源功能測試工具 > Selenium
Selenium自動化測試框架的搭建
作者:網(wǎng)絡(luò)轉(zhuǎn)載 發(fā)布時間:[ 2014/1/7 16:53:42 ] 推薦標簽:自動化測試 Selenium 測試工程

   LoggingResultsFormatter htmlFormatter =

       newHtmlResultFormatter(loggingWriter, resultEncoding);

   htmlFormatter.setScreenShotBaseUri(""); // this is for linkingto the screenshots

   htmlFormatter.setAutomaticScreenshotPath(resultPath);

   // wrapHttpCommandProcessor from remote-control

   LoggingCommandProcessor myProcessor =

       new LoggingCommandProcessor(newHttpCommandProcessor(your-configs), htmlFormatter);

   selenium= new LoggingDefaultSelenium(myProcessor);

   selenium.start();

}

@After

public void tearDown() {

   selenium.stop();

   try {

       if(null != loggingWriter) {

           loggingWriter.close();

       }

   } catch(IOException e) {

       //do nothing

   }

}

7.      運行成功以后在指定的目錄中生成相應(yīng)的reports

七、框架優(yōu)勢

1.      記錄測試的過程,所見即是所得,selenium的所有內(nèi)部程序都是用Javascipt編寫的,比較靈活;

2.      可以通過selenium IDE錄制腳本,腳本可以回放,可以作為junit編碼的雛形;

3.      支持多種操作系統(tǒng);

4.      支持多種編碼語言。JAVA,.NET, Perl,Python, Ruby

八、框架劣勢

1.    selenium的錄制工具只能安裝在firefox瀏覽器上, 如果系統(tǒng)界面不被firefox支持,那要花費一定的時間去手寫case。 不過近聽說有一個工具叫360WebTester ,可以支持IE的錄制,而且是國產(chǎn)的評價還不錯,有時間我要研究一下。

上一頁12345下一頁
軟件測試工具 | 聯(lián)系我們 | 投訴建議 | 誠聘英才 | 申請使用列表 | 網(wǎng)站地圖
滬ICP備07036474 2003-2017 版權(quán)所有 上海澤眾軟件科技有限公司 Shanghai ZeZhong Software Co.,Ltd