Difference between revisions of "テストケース"

From GXtest Wiki
Jump to: navigation, search
(Test Case Validation)
Line 76: Line 76:
  
  
=== Test Case Validation ===
+
=== テストケースの検証 ===
Before running a Test Case you should perform a validation. If a Test Case does not meet all the conditions to run it will not be run.  Some of the possible causes for a Test Case to not be able to run are that there are no events on a certain Edge Line or that a connection is missing. To validate a Test Case press Shift+F6 or click the following button in GXtest:
+
テストケースを実行する前に、検証を実行する必要があります。テストケースは実行するすべての条件に一致しない場合、実行されません。テストケースが実行できない原因には、特定のエッジラインにイベントがない、接続が不明などがあります。テストケースを検証するには、Shift + F6 を押すか、GXtest で次のボタンをクリックします:
  
 
[[Image:BotonValidarTC.jpg|center]]
 
[[Image:BotonValidarTC.jpg|center]]

Revision as of 16:32, 28 March 2014

Spanish.gif
English.gif
Japan.gif
<- 前へ | インデックス | 次へ->

Contents

5. テストケース

各プロジェクトには、アプリケーションをテストするためのテストケースがあります。各テストケースは、回帰テストを自動化するために使用可能なアプリケーションの自動化されたワークフローです。「自動化の注意事項」 を参照してください。


テスト ケース オブジェクト

ページ

ページでは、アプリケーションのページを参照したり、アクションおよび検証のリストを表示したりすることができます。

各ページは GeneXus オブジェクトに関連付けることができます。GXtest Recorder で生成されたテストケースには、常に関連する GeneXus オブジェクトが含まれ、手動で実行する場合であっても、オブジェクトを選択する必要がありません。ただし、同じウィンドウに複数のフレームがある場合や、複数のウィンドウ (たとえばポップアップなど) がある場合、コマンドの実行時には、それらのテストケース内でオブジェクトを選択する必要があります。また、検証を実行している間、ページに定義されているオブジェクトに対応するページで CheckMainObject コマンドが実行されます。

エッジライン

各エッジラインはあるページから次のページへの移行を表します。各エッジラインには、必ず 1 つのイベントが含まれます。また、アクションおよび検証のリストを表示することもできます。

エッジラインの特徴は、特定の順序になることです。ノードに複数のエッジラインがある場合、テストケースの順序は各エッジラインの文字列順になります。次のテストケースの例を参照してください:

PageWithMultipleEdges.jpg

最初は Home ページに移動し、ClickLinkTable エッジラインに従いますが、2度目にはその同じページに戻り、ClickButton のエッジラインに従います。

テストケース (包含)

テスト ケース オブジェクトは別のテストケース内に埋め込むこと (モジュール化) ができます。テスト ケース モデルは再利用することができます。埋め込みテストケースの例については、次の 記事を参照してください。テストケースを別のテストケース内に埋め込む場合には、埋め込みテストケースを実行する回数を指定することができます。この値は、特定の番号にすることも、データプールから取得することもできます。データプールから値を取得した場合、たとえば、請求書の項目数などは、データプールに応じて異なります。

最も重要な点は、テストケースが失敗した場合に実行を停止するよう設定されているテストケースを含んでいる場合、テストケースのいずれかのイテレーション (反復実行) が失敗すると、含まれているその他のテストケースの実行も停止するということです。


条件分岐

条件分岐オブジェクトによって、2 つの異なるワークフローを特定条件に基づいて、アプリケーション内で実行することができます。たとえば、クライアントがウルグアイにいる場合、テストケースは通知をクライアントに送信しますが、クライアントが別の国にいる場合、送信しないようにします。条件分岐を使用すると、クライアントの状況に応じて、2 つの異なるワークフローを実行することができます。 条件分岐の使用例については 「分岐を使用するテストケースの作成」を参照してください。


テストケースの作成

テストケースの作成方法はいくつかあります。手動または GXtest Recorder で記録することで作成することができます。GXtest Recorder にはテストケースを記録する 2 つの方法があります:オンラインとオフライン。


手動によるテストケースの作成

テストケースを手動で作成するには、[プロジェクト] パネルの [テストケース] を右クリックし、 [新規テストケースを作成] を選択します。

Record test case.jpg

このオプションを選択すると、モデルエディターにテストケースが開きます。この新しい空白のページでテストケースのモデルを開始することができます。これを実行するには、移動先のページとそれらのページに接続するエッジラインを作成することで、自動化されたワークフローを描画する必要があります。 ワークフローの準備ができたら、それぞれのエッジラインとページで実行するコマンドを定義する必要があります。


また、使用可能なコマンドのリストを参照してください。


ドラッグ&ドロップで、簡単にモデルエディター内にテストケースを構成することができます。異なるコンポーネント (エッジラインとページ) 間にコマンドをドラッグ&ドロップするだけです。Control キーを押したまま移動またはコピーすることができます。

GXtest Recorder によるテストケースの作成

オンラインとオフラインの違いは、前者は GXtest Designer とともに GXtest Recorder を使用するのに対して、後者は、GXtest Recorder 単体で使用します。オンラインは、テストケースを記録する際に、GXtest Designer で使用する準備をしておきます。オフラインは、GXtest Recorder を GXtest Designer とは別に実行してファイルを生成し、後でそのファイルを GXtest Designer にインポートします。

オンラインメソッド

オンラインメソッドでテストケースを記録するには、[プロジェクト] パネルで [テストケース] を選択し、右クリックで [新規テストケースの記録] を選択します。 ウィンドウが開くと、テストケースの名前と記録を開始する URL を入力します。記録ボタンをクリックすると、必要なアクションを実行するための新しいブラウザウィンドウが開きます。自動化するワークフローが完了したら、ブラウザーのウィンドウを閉じるだけです。

オフラインメソッド

前述のとおり、オフラインメソッドでは、GXtest Designer をインストールせずにテストケースを作成することができます。この場合、ZIP または XML (v1.1.4 以降) ファイルを作成して、GXtest Designer にインポートします。 ZIP/XML ファイルを作成したら、[プロジェクト] パネルで [テストケース] を選択し、右クリックで [テストケースをインポート] を選択して新しいテストケースを作成する必要があります。 次に前の手順で作成した ZIP/XML ファイルを選択します。 この方法の利点は、自動化するために GXtest Designer をインストールする必要がないということです。唯一、Internet Explorer に機能拡張をインストールする必要があります。技術的なサポートが必要な場合、または受け入れテストなどが定義されている場合、すべてのユーザーにとってアプリケーションのワークフローの記録を容易にします。詳細については、GXtest Recorder ユーザーズマニュアルを参照してください


テストケースの検証

テストケースを実行する前に、検証を実行する必要があります。テストケースは実行するすべての条件に一致しない場合、実行されません。テストケースが実行できない原因には、特定のエッジラインにイベントがない、接続が不明などがあります。テストケースを検証するには、Shift + F6 を押すか、GXtest で次のボタンをクリックします:

BotonValidarTC.jpg

Running a Test Case

In GXtest Designer there a several ways of running a Test Case which are described below.

Simple Running of a Test Case

You can run Test Case once by pressing Shift+F5 or clicking the button shown below

Ejecutar.JPG

This will run the open Test Case one time.

Running a Test Case repeatedly

This allows you to run a Test Case as many times as you decide which allows you, for example, to use Data Pools. To repeatedly run a Test Case press Shift+F7 or click the button shown below:

BotonEjecutarN.jpg


Note: When you run N times, after each execution GXtest will close all open windows of the browser selected for execution.

Running a Test Case in an opened browser window

This allows you to run a Test Case in a browser window that is already open. To run a Test Case in an open browser press Ctrl+F5 or click the following button:

BotonPlayInIE.jpg

Note: If you are using Firefox browser (GXtest 1.1 or upper) this functionality can only be used with browser instances opened for GXtest or setted to start with-jssh.

Execution in FireFox (from version 1.1)

To run tests over Firefox you must install the Firefox Extension that can be found over GXtest installation folder : GXtest Designer\Firefox.

"C:\Program Files (x86)\Abstracta\GXtest Designer\Firefox\mozrepl-jssh.xpi" To find a way to install Firefox extensions you may want to take a look at: http://www.wikihow.com/Install-Firefox-Extensions

Para versiones de firefox inferior a 4: 2, 3, 3.5 and 3.6, you should download the plug-in jssh and install it. The plugin can be downloaded at the following links:

Then to tell GXtest Desginer to run using FireFox, change the project properties to the type of browser FireFox.

Note: We recommend disabling automatic updates and "Set as default" dialog in FireFox to avoid failures in the test cases due to this reason.


Important: while running a test case in any browser, GXtest is going to close automaticaly any popup like "do you want to activate autocomplete" or similar ones.

Advice for working with Test Cases

The following lists a couple pieces of advice concerning editing Test Cases.

  • Copy and Paste commands with Drag&Drop: in GXtest its possible to move commands from one element to another by simply dragging them and dropping them. You can also copy commands by holding down the Ctrl key while dragging and dropping.
  • Changing the order an element’s associated commands: click on the element in the commands panel and drag the commands placing them in the desired order.

Exporting and Importing a Test Case

This article shows the specific steps for importing and exporting a Test Case. If you would like more detailed information about XML generators and exporting Test Cases you can consult this article.

Sending and Recieving Test Cases between databases

As mentioned in the Login / Connections section, in GXtest it is possible to configure several connections. This allows:

  • an easy exchange of Test Cases between databases
  • exchange of Test Cases between workstations and the GXtest Manager database
It is important to keep in mind that the names of the projects that contain the Test Cases that are to be transferred ought to be the same.

Internally what happens is an export and then an import of the Test Cases into the corresponding databases. To send a Test Case follow these steps:

  1. Open GXtest using the connection for the original database
  2. Open the project
  3. Go to Test Cases > Send & Receive > Send To
  4. Select the Test Case that you want to send
  5. Choose the data that you want to send it to
  6. It will now show the export options (they include Data Pools, recurring Test Cases, etc.) Then click OK
  7. It will now show the results of the export. Close the results window when finished.
  8. It will now show the results of the import.

To receive a Test Case follow these steps:

  1. Open GXtest using the connection for the original database
  2. Open the project
  3. Go to Test Cases > Send & Receive > Receive From
  4. Choose the database that is going to receive the Test Case
  5. Then choose the Test Case that is going to be received and the options that you want.
  6. You will then see the results of the export and then the results of the import in the local database.




<- 前へ | 次へ->


GXtest Designer ユーザーズマニュアルに戻る