2. 運行ant腳本以后,可以生成相應(yīng)的junit日志。
selenium日志
當(dāng)運行junit腳本時,selenium相關(guān)的腳本會產(chǎn)生回放日志,但默認(rèn)記錄的東西可讀性太差了,所以我們使用loggingSelenium(http://loggingselenium.sourceforge.net/usage.html) ,可以將每個case可以生成記錄selenium命令的html格式的result了。
4. plugin的下載地址:
http://sourceforge.net/projects/loggingselenium/files/loggingselenium/Release%201.2/logging-selenium-1.2.jar/download
5. 安裝方法:只需要將下載的logging-selenium-1.2.jar導(dǎo)入到工程里即可。
6. 編寫代碼如下
@Before
public void setUp() {
finalString resultPath ="absolute-path-to-where-your-result-will-be-written";
finalString resultHtmlFileName = resultPath + File.separator +"result.html";
finalString resultEncoding = "UTF-8"
loggingWriter = LoggingUtils.createWriter(resultHtmlFileName,resultEncoding);