Qaf: Excelテストファクトリの実装

作成日 2018年05月29日  ·  9コメント  ·  ソース: qmetry/qaf

QAFバージョン

注:最新バージョンのみがサポートされています

再現する手順

1. Create a xls file under scenario
2.In the config file use the ExcelTestFactory class
3.Execute

予想される行動

正常に実行されるはずです

実際の動作

jxl.read.biff.BiffException:OLEストリームを認識できません
jxl.read.biff.CompoundFile。(CompoundFile.java:116)で
jxl.read.biff.File。(File.java:127)で
jxl.Workbook.getWorkbook(Workbook.java:221)で
jxl.Workbook.getWorkbook(Workbook.java:198)で
com.qmetry.qaf.automation.step.client.excel.ExcelScenarioFileParser.parseFile(ExcelScenarioFileParser.java:46)で
com.qmetry.qaf.automation.step.client.excel.ExcelScenarioFileParser.parse(ExcelScenarioFileParser.java:60)で
com.qmetry.qaf.automation.step.client.ScenarioFactory.process(ScenarioFactory.java:110)で
com.qmetry.qaf.automation.step.client.ScenarioFactory.getTestsFromFile(ScenarioFactory.java:82)で
sun.reflect.NativeMethodAccessorImpl.invoke0(ネイティブメソッド)で
sun.reflect.NativeMethodAccessorImpl.invoke(不明なソース)で
sun.reflect.DelegatingMethodAccessorImpl.invoke(不明なソース)で
java.lang.reflect.Method.invoke(不明なソース)で
org.testng.internal.FactoryMethod.invoke(FactoryMethod.java:90)で
org.testng.internal.TestNGClassFinder。(TestNGClassFinder.java:150)で
org.testng.TestRunner.initMethods(TestRunner.java:451)で
org.testng.TestRunner.init(TestRunner.java:270)で
org.testng.TestRunner.init(TestRunner.java:240)で
org.testng.TestRunner。(TestRunner.java:192)で
org.testng.remote.support.RemoteTestNG6_9_10 $ 1.newTestRunner(RemoteTestNG6_9_10.java:29)で
org.testng.remote.support.RemoteTestNG6_9_10 $ DelegatingTestRunnerFactory.newTestRunner(RemoteTestNG6_9_10.java:65)で
org.testng.SuiteRunner $ ProxyTestRunnerFactory.newTestRunner(SuiteRunner.java:594)で
org.testng.SuiteRunner.init(SuiteRunner.java:168)で
org.testng.SuiteRunner。(SuiteRunner.java:117)で
org.testng.TestNG.createSuiteRunner(TestNG.java:1319)で
org.testng.TestNG.createSuiteRunners(TestNG.java:1306)で
org.testng.TestNG.runSuitesLocally(TestNG.java:1160)で
org.testng.TestNG.run(TestNG.java:1064)で
org.testng.remote.AbstractRemoteTestNG.run(AbstractRemoteTestNG.java:114)で
org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:251)で
org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:77)で

問題はランナーで再現可能ですか?

  • [x] Eclipse

テストケースサンプル

構成ファイル:



</classes>

help wanted kwd-excel

全てのコメント9件

設定ファイルのコードを更新して、使用しているExcelファイルを提供していただけますか?

構成ファイル:

<test name="Test" enabled="true">
<parameter name="scenario.file.loc" value="./scenarios/Platform_Automation/test.xls"></parameter>
    <classes>
        <class name="com.qmetry.qaf.automation.step.client.excel.ExcelTestFactory" />



    </classes>
</test>

Excelシート:

エクセルシートを添付できません。 ただし、以下はExcelシートの内容であり、シート名はtest.xlsです。

シナリオ:バッチプロセッサ| | | | | |
-| -| -| -| -| -| -
メタデータ:{"description": "Verify"、 "groups":[SMOKE "、" Regression "]、" author ":" Arun "}
| | | | | | | | |
| 'virtual.machine'で '$ {unix.command.ondot-status}'を実行すると| |
| 次に、アクティブ検証のondot-status | | | | |
終了| | | | | | | | |

Excel用に定義した形式が間違った形式です。
以下は、動作テストとExcelファイルです。

<test name="Test" enabled="true">
    <parameter name="scenario.file.loc" value="./scenarios/test.xls"></parameter>
    <classes>
        <class name="com.qmetry.qaf.automation.step.client.excel.ExcelTestFactory" />
    </classes>
</test>

シナリオ| SearchProduct | {"description": "ユーザーが検索テキストボックスを使用して商品を検索できることを確認する"、 "groups":["SMOKE"]}
-| -| -
launchApp | |
searchForProduct | ["シャツ"] |
終了| |

ここで、最初の列はステップ名(説明ではない)である必要があり、2番目の列は引数のリストです。
そしてステップの実装は

@QAFTestStep(description = "I search for product {0}")
public void searchForProduct(String product) {
    //to-do
}

Excel形式を変更しましたが、それでも同じエラーが発生します。 このためのサンプルプロジェクトはありますか?

シナリオ| テスト| {"description": "ユーザーが検索テキストボックスを使用して商品を検索できることを確認する"、 "groups":["SMOKE"]}
-| -| -
実行| ["こんにちは"] |
終了| |

また、複数の入力を渡したい場合はどうすればよいですか:)

前もって感謝します :)

Excelが適切なxls形式ではないようです。

ありがとうアミット:)それは正しかった。 私は壊れたファイルを使用していました:)どうもありがとう。

また、Excelファイルで1つの入力を使用し、メソッドは1つのパラメーターを取ります。 しかし、私がシートで与えている入力は渡されていません。

共有した上記のExcelシートのステップ定義を共有していただけますか? :)

上記のコメントでステップの実装を更新しました。 あなたはそれを参照することができます。

ありがとう:)うまくいきました:)私は実際にbddシナリオをExcelシートにコピーして貼り付けました:)そしてそれはxmlとプロパティファイルからデータを読み取りました:)

幸せ:)助けてくれてありがとうアミット:)

こんにちはアミット、

私はこのシナリオを持っています。 JSONArrayまたはJsonObjectを入力として渡す必要があります。 ExcelTestFactoryを使用しています。

以下は私のサンプル入力です:

["ノード名"、["a"、 "b"、 "c"]]

全世界を読んでもらいたい。 カンマが入っているので、QAFは全体を読み取ることができません。

これに対処する方法を教えてください:)

助けてくれてありがとう。

また、入力は外部チームからのものであるため、これらの値を外部ファイルに保存することはできません。

よろしくお願いいたします。
CK

このページは役に立ちましたか?
0 / 5 - 0 評価