翻訳は機械翻訳により提供されています。提供された翻訳内容と英語版の間で齟齬、不一致または矛盾がある場合、英語版が優先します。
AWS Device Farm での Appium Java TestNG テストのトラブルシューティング
以下のトピックでは、Appium Java TestNG テストのアップロード中に発生するエラーメッセージを挙げ、各エラーを解決するための推奨回避策を伝えます。
アップロードエラー
Appium Java TestNG テストをアップロードすると、次のエラーが発生する可能性があります。
APPIUM_JAVA_TESTNG_TEST_PACKAGE_UNZIP_FAILED
次のメッセージが表示された場合は、下の手順に従って問題を解決してください。
警告
テスト ZIP ファイルを開けませんでした。ファイルが有効であることを確認して、もう一度お試しください。
エラーなしでテストパッケージを解凍できることを確かめてください。次の例では、パッケージ名は「zip-with-dependencies.zip」です。
-
テストパッケージを作業ディレクトリにコピーし、次のコマンドを実行します:
$ unzip zip-with-dependencies.zip -
正常にパッケージを解凍すると、次のコマンドを実行すれば作業ディレクトリのツリー構造を見つけることができます:
$ 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詳細については、「Device Farm で Appium テストを自動的に実行する」を参照してください。
APPIUM_JAVA_TESTNG_TEST_PACKAGE_DEPENDENCY_DIR_MISSING
次のメッセージが表示された場合は、下の手順に従って問題を解決してください。
警告
dependency-jars ディレクトリがテストパッケージ内に見つかりませんでした。テストパッケージを解凍し、dependency-jars ディレクトリがパッケージ内にあることを確認して、もう一度試してください。
次の例では、パッケージ名は「zip-with-dependencies.zip」です。
-
テストパッケージを作業ディレクトリにコピーし、次のコマンドを実行します:
$ unzip zip-with-dependencies.zip -
正常にパッケージを解凍したら、次のコマンドを実行して作業ディレクトリのツリー構造を見つけることができます:
$ 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詳細については、「Device Farm で Appium テストを自動的に実行する」を参照してください。
APPIUM_JAVA_TESTNG_TEST_PACKAGE_JAR_MISSING_IN_DEPENDENCY_DIR
次のメッセージが表示された場合は、下の手順に従って問題を解決してください。
警告
dependency-jars ディレクトリツリー内に JAR ファイルが見つかりませんでした。テストパッケージを解凍してから dependency-jars ディレクトリを開き、少なくとも 1 つの JAR ファイルがディレクトリにあることを確認して、もう一度やり直してください。
次の例では、パッケージ名は「zip-with-dependencies.zip」です。
-
テストパッケージを作業ディレクトリにコピーし、次のコマンドを実行します:
$ unzip zip-with-dependencies.zip -
正常にパッケージを解凍したら、次のコマンドを実行して作業ディレクトリのツリー構造を見つけることができます:
$ tree .Appium Java JUnit パッケージが有効な場合は、
dependency-jarsディレクトリ内に少なくとも 1 つの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詳細については、「Device Farm で Appium テストを自動的に実行する」を参照してください。
APPIUM_JAVA_TESTNG_TEST_PACKAGE_TESTS_JAR_FILE_MISSING
次のメッセージが表示された場合は、下の手順に従って問題を解決してください。
警告
テストパッケージ内に *-tests.jar ファイルが見つかりませんでした。テストパッケージを解凍し、パッケージ内に少なくとも 1 つの *-tests.jar ファイルがあることを確認して、もう一度やり直してください。
次の例では、パッケージ名は「zip-with-dependencies.zip」です。
-
テストパッケージを作業ディレクトリにコピーし、次のコマンドを実行します:
$ unzip zip-with-dependencies.zip -
正常にパッケージを解凍すると、次のコマンドを実行すれば作業ディレクトリのツリー構造を見つけることができます:
$ tree .Appium Java JUnit パッケージが有効な場合は、この例の
acme-android-appium-1.0-SNAPSHOT-tests.jarのようなjarファイルが少なくとも 1 つあります。ファイルの名前は異なる場合がありますが、–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詳細については、「Device Farm で Appium テストを自動的に実行する」を参照してください。
APPIUM_JAVA_TESTNG_TEST_PACKAGE_CLASS_FILE_MISSING_IN_TESTS_JAR
次のメッセージが表示された場合は、下の手順に従って問題を解決してください。
警告
テスト JAR ファイル内にクラスファイルが見つかりませんでした。テストパッケージを解凍してから、テスト JAR ファイルをアンジャーし、JAR ファイル内に少なくとも 1 つのクラスファイルがあることを確認して、もう一度やり直してください。
次の例では、パッケージ名は「zip-with-dependencies.zip」です。
-
テストパッケージを作業ディレクトリにコピーし、次のコマンドを実行します:
$ unzip zip-with-dependencies.zip -
正常にパッケージを解凍すると、次のコマンドを実行すれば作業ディレクトリのツリー構造を見つけることができます:
$ tree .この例の
acme-android-appium-1.0-SNAPSHOT-tests.jarのような jar ファイルが少なくとも 1 つあります。ファイルの名前は異なる場合がありますが、–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 -
その jar ファイルからファイルを抽出するには、次のコマンドを実行します:
$ jar xf acme-android-appium-1.0-SNAPSHOT-tests.jar -
ファイルの抽出が正常に完了したら、次のコマンドを実行します:
$ tree .作業ディレクトリツリーで、少なくとも 1 つのクラスがあるはずです:
. |— 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詳細については、「Device Farm で Appium テストを自動的に実行する」を参照してください。
インサイトをテストする
インサイトのテストをオプトインすると、Device Farm は実行とその下の各ジョブの概要レポートを生成します。サービスがレポートを生成できない場合、インサイトレポートのステータスは SKIPPEDまたは でありERRORED、レポートメッセージにその理由が示されます。Appium Java TestNG テストのインサイトを生成するときに、次のメッセージが発生する可能性があります。
ジョブは完了するまで実行されませんでした
Unable to generate test insights because the job was
status.
ジョブは成功しない状態 (ステータスが STOPPED、、または SKIPPED) で終了したためERRORED、要約する結果はありませんでした。失敗した状態で終了した実行は、引き続きインサイトを受け取ります。
この問題を解決するには、ジョブが完了まで実行されなかった理由を調べます。多くの場合、ジョブ自体の messageフィールドは、ジョブが完了しなかった理由を説明する可能性があります。
結果にはテストケースが含まれていません
Test insights could not be generated. The testng-results.xml file was
parsed successfully but contained no test cases.
結果アーティファクトは正常に解析されましたが、テストケースはゼロでした。
この問題を解決するには、テストスイートに少なくとも 1 つのテストケースが含まれ、結果が に正しく保存されていることを確認します$DEVICEFARM_LOG_DIR。
テスト出力がサポートされている最大サイズを超えています
Unable to generate test insights: test output "testng-results.xml"
exceeds the maximum supported size of 1GB.
testng-results.xml が 1 GB を超えています。
この問題を解決するには、ログまたは添付ファイルをトリミングして testng-results.xml サイズを 1 GB 未満に減らします。
testng-results.xml ファイルが見つかりませんでした
Unable to generate test insights. The test results file
(testng-results.xml) was not found.
testng-results.xml ファイル (および TestNG ルート署名を持つ XML エントリ) が見つかりませんでした。
この問題を解決するには、TestNG XML をアーティファクトディレクトリ () に出力するようにフレームワークを設定します$DEVICEFARM_LOG_DIR。
testng-results.xml ファイルを処理できませんでした
Test insights could not be generated because of an error while processing
testng-results.xml.
XML ファイルの形式が正しくないか、解析できませんでした。
この問題を解決するには、ファイルが標準の TestNG レポート形式の適切な形式の XML であることを確認します。