<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                合規國際互聯網加速 OSASE為企業客戶提供高速穩定SD-WAN國際加速解決方案。 廣告
                # 10E 高級 WebDriver – 生成 PDF 報告 > 原文: [https://javabeginnerstutorial.com/selenium/10e-advanced-webdriver-generating-pdf-report/](https://javabeginnerstutorial.com/selenium/10e-advanced-webdriver-generating-pdf-report/) 嗨冠軍! 到目前為止,我們在報告方面已經涵蓋了很多基礎,您已經達到了高潮文章。 如果要將 HTML 報告附加到電子郵件并將其發送給利益相關者,則生成 HTML 報告可能沒有幫助。 由于 ANT 生成的 JUnit 報告具有`index.html`文件,該文件又嵌入了其他一些 HTML 文件,例如`overview-frame.html`,`allclass-frame.html`和`overview-summary.html`文件。 在這種情況下我們該怎么辦? 我們如何將其附加到電子郵件? 我們不能將其作為單個文件而不是一組 HTML 文件獲得嗎? – 所有這些問題的唯一答案是,生成一個 **PDF 文件**。 讓我們看看在不干擾我們到目前為止所做的[自定義](https://javabeginnerstutorial.com/selenium/10c-advanced-webdriver-junit-report-customization/)的情況下生成 PDF 報告的過程, ## 步驟 1: 我們需要 JUnit PDF 報告*要點*分發。 它還包含所有必需的依賴項。 從鏈接“https://sourceforge.net/projects/junitpdfreport/files/”下載最新版本的“必要” zip 文件。 ![PDF Essentials Download](https://img.kancloud.cn/79/37/7937d0a0d0727cf9fe9bdb2e987992f2_792x382.png) 將文件內容解壓縮到本地文件夾并記下路徑。 另外,請確保分發中包含“`build-junitpdfreport.xml`”文件和“`lib`”文件夾以及某些其他文件和文件夾。 ## 步驟 2: 是時候在 Eclipse IDE 中瀏覽“`Build.xml`”文件了。 有幾行要添加。 首先要做的是告訴我們的項目,該`junitpdfreport`基本 zip 文件的內容在哪里提取。 在構建文件的`project`標簽中,將以下行及其路徑添加到分發位置。 ```xml <!-- JUnit PDF report installation location --> <import file="E:/junitpdfreport_essentials_1_0/build-junitpdfreport.xml"/> ``` ## 步驟 3: 將以下目標也添加到構建文件中,以便 ANT 知道該怎么做。 ```xml <!-- PDF Report --> <target name="pdfReport"> <junitpdfreport todir="${junit.output.dir}" styledir="default"> <fileset dir="${junit.output.dir}"> <include name="TEST-*.xml"/> </fileset> </junitpdfreport> </target> ``` 讓我們嘗試一次解密這一行, 1\. `junitpdfreport todir="${junit.output.dir}"` 這是將生成的 pdf 報告保存的位置。 2\. `fileset dir="${junit.output.dir}"` 提供所有 JUnit 測試結果所在的位置(請記住為執行的每個測試生成的 XML 文件,格式為“`TEST-*.xml`”)。 就我而言,我有以下測試文件:`TEST-com.blog.junitTests.RadioBtns_Checkboxes.xml`,`TEST-com.blog.junitTests.SelectItems.xml`和`TESTS-TestSuites.xml`保存在位置`junit/`。 ## 步驟 4: 右鍵單擊并選擇“2 ANT Build”,然后在“編輯配置”彈出窗口中選中“目標”標簽。 確保已選中“pdfReport”目標,它是執行順序中提到的最后一個目標。 ![PDF target configuration](https://img.kancloud.cn/40/55/40556234804f38c6a577afe72823b7c2_782x521.png) 點擊“運行”以執行構建文件。 ## 步驟 5: 在指定的輸出目錄(本例中為“`junit/`”)中驗證生成的 PDF 報告。 ![JUnit Folder](https://img.kancloud.cn/d2/91/d291cbe60f424890b47c5e49e1a9a819_461x397.png) 生成的 PDF 文件共有 8 頁。 例如,前 5 頁如下所示, ![PDF report part 1](https://img.kancloud.cn/e3/8d/e38d2d41fed7c39d3f38e775e9c694ab_872x493.png) ![PDF Report part 2](https://img.kancloud.cn/7b/bf/7bbf39e7e135e9e0926cfe1ccd579e65_873x472.png) 最后但并非最不重要的是,該構建文件的快照顯示了 HTML 報告和 PDF 報告目標代碼, ![ANT buildfile](https://img.kancloud.cn/72/1f/721fe0ee0215c8ab9dfeeae23dce5787_873x592.png) 在您達到本文結尾時,讓我們利用練習的力量。 在另一個主題上再見,讓您掌握 WebDriver!
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看