Testrail-import-testcases-xml

提供:Dev Guides
移動先:案内検索

TestRail-TestCases XMLのインポート

ユーザーは、XMLファイルを使用して、一度に複数のテストケースとセクションを作成できます。 XMLからデータをインポートするには、プロセスに必要な2つのステップがあります。

  • XMLファイルのルール
  • ファイルをシステムにインポートします

XMLファイルのルール

次の点を考慮してXMLファイルを作成する際に考慮する必要があります

  • XML形式はツリー構造にする必要があります。 セクション、テストケース、サブセクションから開始する必要があります。
  • XML形式は次のようになります
<section>
   <name>Login Functionality<name>
   <description>All test case related to login functionality. Positive and negative test cases</description>
   <case>
      <id>C2</id>
      <title>Correct Username and Passwordcombination</title>
      <template>Test Case (Text)<template>
      <type>Other<type>
      <priority>Medium<priority>
      <estimate/>
      <references/>
      <custom>
         <preconds>Login page should display</preconds>
         <steps>1. Enter correct username 2.enter correct password</steps>
         <expected>Usershould able to login successfully.</expected>
      </custom>
   </case>
</section>
  • <case>タグは、タイトル、見積もり、優先度、テキストフィールド、前提条件、ステップ、期待される結果など、TestRailのテストケースのすべてのプロパティをサポートします。
  • カスタムフィールドは<custom>タグの下にグループ化されます。
  • 次の表に、さまざまなカスタムフィールドタイプのインポート形式を示します
Type Sample Value Description
Checkbox TRUE "true" or "false" (without the quotes)
Date 01-07-2010 A valid XML date string in yyyy-mm-dd format
Dropdown <id>5</id> The ID of the value (as configured in the custom field options in the administration area) in an <id> tag
Integer 1022 A simple integer number
Milestone <id>2</id> The ID of the milestone in an <id> tag
Multi−select
<item>
   <id>1</id>
</item>
<item>
   <id>2</id>
</item>
A list of <item> records, each with its own ID (so, like a list of Dropdown values)
Steps
<step>
   <index>1</index>
   <content>Step 1</content>
   <expected>Result 1</expected>
</step>
<step>
    <index>2</index><content>Step 2</content>
</step>
A list of <step> records, each with its own index, content and optionally expected result
String/Text Foobar A simple string
URL (Link) http//google.com/ A simple URL as string
User <id>3</id> The ID of the user in an <id> tag

CSVファイルをインポート

  • [テストケース]タブに移動します。
  • 右側のインポートテストケースアイコンをクリックし、[XMLからインポート]オプションを選択します。

次のスクリーンショットは、テストケースのインポートアイコンとXMLの選択を示しています

CSVファイルのインポート

  • [XMLからインポート]ウィザードが開きます。 XMLファイルを参照してアップロードします。
  • ユーザーは、新しいテストケースを追加したり、既存のテストケースを更新したりできます。
  • 選択後、[インポート]ボタンをクリックします。

次のスクリーンショットは、XMLファイルをエクスポートする方法を示しています

XMLファイルのエクスポート