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

   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ùn)行成功以后在指定的目錄中生成相應(yīng)的reports

七、框架優(yōu)勢(shì)

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

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

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

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

八、框架劣勢(shì)

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

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