對 AWS Device Farm 中的 Appium Java TestNG Web 應用程式進行故障診斷 - AWS Device Farm

本文為英文版的機器翻譯版本,如內容有任何歧義或不一致之處,概以英文版為準。

對 AWS Device Farm 中的 Appium Java TestNG Web 應用程式進行故障診斷

下列主題會列出在上傳 Appium Java TestNG Web 應用程式測試期間出現的錯誤訊息,並建議解決每個錯誤的解決方法。

APPIUM_WEB_JAVA_TESTNG_TEST_PACKAGE_UNZIP_FAILED

如果您看到下列訊息,請依照以下步驟修復問題。

警告

我們無法開啟您的測試ZIP檔案。請確認檔案是否有效,然後再試一次。

請確認您可以正確解壓縮測試套件。在下列範例中,套件的名稱為 zip-with-dependencies.zip

  1. 將您的測試套件複製到工作目錄,然後執行下列命令:

    $ unzip zip-with-dependencies.zip
  2. 成功解壓縮套件後,您可以透過執行下列命令找到樹狀結構的工作目錄:

    $ tree .

    有效的 Appium Java JUnit套件應產生如下所示的輸出:

    . |— acme-android-appium-1.0-SNAPSHOT.jar (this is the JAR containing everything built from the ./src/main directory) |— acme-android-appium-1.0-SNAPSHOT-tests.jar (this is the JAR containing everything built from the ./src/test directory) |— zip-with-dependencies.zip (this .zip file contains all of the items) `— dependency-jars (this is the directory that contains all of your dependencies, built as JAR files) |— com.some-dependency.bar-4.1.jar |— com.another-dependency.thing-1.0.jar |— joda-time-2.7.jar `— log4j-1.2.14.jar

    如需詳細資訊,請參閱Appium 測試和 AWS Device Farm

APPIUM_WEB_JAVA_TESTNG_TEST_PACKAGE_DEPENDENCY_DIR_MISSING

如果您看到下列訊息,請依照以下步驟修復問題。

警告

在測試套件找不到相依性 jar 目錄。請解壓縮您的測試套件,確認相依性 jar 目錄位於套件中,然後再試一次。

在下列範例中,套件的名稱為 zip-with-dependencies.zip

  1. 將您的測試套件複製到工作目錄,然後執行下列命令:

    $ unzip zip-with-dependencies.zip
  2. 成功解壓縮套件後,您可以透過執行下列命令找到樹狀結構的工作目錄:

    $ tree .

    如果 Appium Java JUnit套件有效,您會找到 dependency-jars 工作目錄內的目錄。

    . |— acme-android-appium-1.0-SNAPSHOT.jar (this is the JAR containing everything built from the ./src/main directory) |— acme-android-appium-1.0-SNAPSHOT-tests.jar (this is the JAR containing everything built from the ./src/test directory) |— zip-with-dependencies.zip (this .zip file contains all of the items) `— dependency-jars (this is the directory that contains all of your dependencies, built as JAR files) |— com.some-dependency.bar-4.1.jar |— com.another-dependency.thing-1.0.jar |— joda-time-2.7.jar `— log4j-1.2.14.jar

    如需詳細資訊,請參閱Appium 測試和 AWS Device Farm

APPIUM_WEB_JAVA_TESTNG_TESTPACKAGE_JAR_MISSING__IN_DEPENDENCY_DIR

如果您看到下列訊息,請依照以下步驟修復問題。

警告

我們在 dependency-jars 目錄樹狀目錄中找不到JAR檔案。請解壓縮您的測試套件,然後開啟 dependency-jars 目錄,確認目錄中至少有一個JAR檔案,然後再試一次。

在下列範例中,套件的名稱為 zip-with-dependencies.zip

  1. 將您的測試套件複製到工作目錄,然後執行下列命令:

    $ unzip zip-with-dependencies.zip
  2. 成功解壓縮套件後,您可以透過執行下列命令找到樹狀結構的工作目錄:

    $ tree .

    如果 Appium Java JUnit套件有效,您會找到至少一個 jar 檔案位於 dependency-jars 目錄。

    . |— acme-android-appium-1.0-SNAPSHOT.jar (this is the JAR containing everything built from the ./src/main directory) |— acme-android-appium-1.0-SNAPSHOT-tests.jar (this is the JAR containing everything built from the ./src/test directory) |— zip-with-dependencies.zip (this .zip file contains all of the items) `— dependency-jars (this is the directory that contains all of your dependencies, built as JAR files) |— com.some-dependency.bar-4.1.jar |— com.another-dependency.thing-1.0.jar |— joda-time-2.7.jar `— log4j-1.2.14.jar

    如需詳細資訊,請參閱Appium 測試和 AWS Device Farm

APPIUM_WEB_JAVA_TESTNG_TEST_PACKAGE_TESTS_JAR_FILE_MISSING

如果您看到下列訊息,請依照以下步驟修復問題。

警告

在您的測試套件中找不到 *-tests.jar 檔案。請解壓縮您的測試套件,確認至少一個 *-tests.jar 檔案位於套件中,然後再試一次。

在下列範例中,套件的名稱為 zip-with-dependencies.zip

  1. 將您的測試套件複製到工作目錄,然後執行下列命令:

    $ unzip zip-with-dependencies.zip
  2. 成功解壓縮套件後,您可以透過執行下列命令找到樹狀結構的工作目錄:

    $ tree .

    如果 Appium Java JUnit套件有效,您會找到至少一個 jar 檔案,例如 acme-android-appium-1.0-SNAPSHOT-tests.jar 在我們的範例中。檔案名稱可能不同,但結尾應為 –tests.jar.

    . |— acme-android-appium-1.0-SNAPSHOT.jar (this is the JAR containing everything built from the ./src/main directory) |— acme-android-appium-1.0-SNAPSHOT-tests.jar (this is the JAR containing everything built from the ./src/test directory) |— zip-with-dependencies.zip (this .zip file contains all of the items) `— dependency-jars (this is the directory that contains all of your dependencies, built as JAR files) |— com.some-dependency.bar-4.1.jar |— com.another-dependency.thing-1.0.jar |— joda-time-2.7.jar `— log4j-1.2.14.jar

    如需詳細資訊,請參閱Appium 測試和 AWS Device Farm

APPIUM_WEB_JAVA_TESTNG_TESTPACKAGE_CLASS__FILE_MISSING_IN_TESTS_JAR

如果您看到下列訊息,請依照以下步驟修復問題。

警告

我們在測試檔案中找不到類別JAR檔案。請解壓縮您的測試套件,然後解壓縮測試JAR檔案,確認檔案中至少有一個類別檔案JAR,然後再試一次。

在下列範例中,套件的名稱為 zip-with-dependencies.zip

  1. 將您的測試套件複製到工作目錄,然後執行下列命令:

    $ unzip zip-with-dependencies.zip
  2. 成功解壓縮套件後,您可以透過執行下列命令找到樹狀結構的工作目錄:

    $ tree .

    您應該找到至少一個 jar 檔案,例如 acme-android-appium-1.0-SNAPSHOT-tests.jar 在我們的範例中。檔案名稱可能不同,但結尾應為 –tests.jar.

    . |— acme-android-appium-1.0-SNAPSHOT.jar (this is the JAR containing everything built from the ./src/main directory) |— acme-android-appium-1.0-SNAPSHOT-tests.jar (this is the JAR containing everything built from the ./src/test directory) |— zip-with-dependencies.zip (this .zip file contains all of the items) `— dependency-jars (this is the directory that contains all of your dependencies, built as JAR files) |— com.some-dependency.bar-4.1.jar |— com.another-dependency.thing-1.0.jar |— joda-time-2.7.jar `— log4j-1.2.14.jar
  3. 若要從 JAR 檔案中擷取檔案,您可執行以下命令:

    $ jar xf acme-android-appium-1.0-SNAPSHOT-tests.jar
  4. 成功擷取檔案後,請執行下列命令:

    $ tree .

    您應可在工作目錄樹狀結構中找到至少一個類別:

    . |— acme-android-appium-1.0-SNAPSHOT.jar (this is the JAR containing everything built from the ./src/main directory) |— acme-android-appium-1.0-SNAPSHOT-tests.jar (this is the JAR containing everything built from the ./src/test directory) |- one-class-file.class |- folder | `— another-class-file.class |— zip-with-dependencies.zip (this .zip file contains all of the items) `— dependency-jars (this is the directory that contains all of your dependencies, built as JAR files) |— com.some-dependency.bar-4.1.jar |— com.another-dependency.thing-1.0.jar |— joda-time-2.7.jar `— log4j-1.2.14.jar

    如需詳細資訊,請參閱Appium 測試和 AWS Device Farm