Einem Test zugeordneten Datenpool erstellen

Sie können im Arbeitsbereich Datenpools mit variablen Daten erstellen, die von Tests bei der Ausführung verwendet werden. Dies ist das bevorzugte Verfahren zum Erstellen eines Datenpools, da der Datenpool automatisch einem Test zugeordnet wird. Sie können beliebige Datenpools erstellen, angefangen bei einem leeren Datenpool, der eine einzige Spalte zur späteren Bearbeitung enthält, bis hin zu einem vollständig funktionsfähigen Datenpool.

Vorgehensweise

  1. Navigieren Sie im Testnavigator zu dem Test, und klicken Sie doppelt darauf. Der Test wird geöffnet.
  2. Klicken Sie im Bereich Testinhalte auf den Namen des Tests.
  3. Klicken Sie auf der Registerkarte Allgemeine Optionen auf Datenpool hinzufügen. Mithilfe der in der folgenden Tabelle aufgeführten Optionen können Sie vom einfachen Datenpool (den Sie später bearbeiten können) bis hin zum kompletten Datenpool alles erstellen.
    Zu erstellender Datenpool Schritte im Fenster "Testeditor - Datenpool hinzufügen"
    Ein einspaltiger Datenpool mit Standardzugriffsmodus. Wählen Sie unter Im Arbeitsbereich vorhandene Datenpools die Option Neuer Datenpool <testname>.datapool aus, und klicken Sie dann auf Fertigstellen. Sie können, falls gewünscht, die Datenpoolspalte in dieser Sitzung benennen und später weitere Spalten und Daten hinzufügen.
    Ein einspaltiger Datenpool mit Auswahl des Zugriffsmodus. Wählen Sie unter Im Arbeitsbereich vorhandene Datenpools die Option Neuer Datenpool <testname>.datapool aus, und klicken Sie auf Weiter. Sie werden zur Angabe des Zugriffsmodus aufgefordert. Sie können, falls gewünscht, die Datenpoolspalte in dieser Sitzung benennen und später weitere Spalten und Daten hinzufügen.
    Eine Zuordnung zwischen dem Test und einem vorhandenen Datenpool. Wählen Sie den Datenpool aus. Der Datenpool wird dem Test zugeordnet. Sie haben auch die Möglichkeit, in dieser Sitzung den Zugriffsmodus festzulegen.
    Ein neuer, vollständig funktionsfähiger Datenpool. Wählen Sie ein Projekt aus, und klicken Sie auf Neuen Datenpool mit Assistent erstellen.
  4. Wählen Sie den Modus für Öffnen für den Datenpool aus. Dieser Modus bestimmt die Sicht des Datenpools, die virtuellen Benutzern zur Verfügung steht. Unterschiedliche Tests können denselben Datenpool auf unterschiedliche Weise öffnen; Sie können den Zugriffsmodus zu einem späteren Zeitpunkt ändern, indem Sie den Test öffnen und doppelt auf den Datenpooltitel klicken.
    Option Bezeichnung
    Gemeinsam genutzt (pro System) (Standardeinstellung)

    Virtual users on each computer draw from a shared view of the datapool, with datapool rows apportioned to them collectively in sequential order, on a first-come-first-served basis.

    This option makes it likely that the virtual users or loop iterations will use data from different rows and that the server will see variable data. The exact row access order among all virtual users or iterations cannot be predicted, because this order depends on the test execution order and the duration of the test on each computer.

    Nicht öffentlich

    Each virtual user draws from a private view of the datapool, with datapool rows apportioned to each user in sequential order.

    This option ensures that each virtual user gets the same data from the datapool in the same order. However, because each user starts with the first row of the datapool and accesses the rows in order, different virtual users will use the same row. The next row of the datapool is used only if you add the test that is using the datapool to a schedule loop with more than one iteration.

    Segmentiert (pro System)

    Virtual users on each computer draw from a segmented view of the datapool, with data apportioned to them collectively from their segment in sequential order, on a first-come-first-served basis. The segments are computed based on how a schedule apportions virtual users among computers. For example, if a schedule assigns 25% of users to group 1 and 75% to group 2, and assigns these groups to computer 1 and computer 2, the computer 1 view will consist of the first 25% of datapool rows and the computer 2 view will consist of the remaining 75% of rows.

    This option prevents virtual users from selecting duplicate values (for example, account IDs). If you disable wrapping, no row can be used more than once.

  5. Wenn Sie in dieser Sitzung festlegen, wie der Test auf den Datenpool zugreift, wählen Sie eine der folgenden Optionen aus. Verschiedene Tests können auf unterschiedliche Weise auf denselben Datenpool zugreifen. Sie können den Zugriffsmodus später ändern, indem Sie den Test öffnen und doppelt auf den Datenpooltitel klicken.
    • Sequential: Rows in the datapool are accessed in the order in which they are physically stored in the datapool file, beginning with the first row and ending with the last.
    • Random: Rows in the datapool are accessed in any order, and any given row can be accessed multiple times or not at all. Each row has an equal chance of being selected each time.
    • Shuffled: Before each datapool access, the order of the rows is changed, and a different sequence results. Rows are accessed randomly but all rows must be selected once before a row is selected again.

    Think of the nonsequential access order (Random and Shuffled) as being like a shuffled deck of cards. With Random access order, the selected card is returned anywhere in the deck, which means that one card might be selected multiple times before another is selected once. Because you never reach the end of the deck, Wrap when the last row is reached is unavailable. With Shuffled access order, the selected card is returned to the bottom of the deck. After each card has been selected once, you either resume selecting from the top with the same access order (Wrap when the last row is reached is Yes), or no more selections are made (Wrap when the last row is reached is No).

  6. Wählen Sie eine der folgenden Optionen aus.
    Option Bezeichnung
    Bei Erreichen der letzten Zeile umbrechen

    By default, when a test reaches the end of a datapool or datapool segment, it reuses the data from the beginning. To force a test to stop at the end of a datapool or segment, clear the check box beside Wrap when the last row is reached. Forcing a stop might be useful if, for example, a datapool contains 15 records, you run a test with 20 virtual users, and you do not want the last five users to reuse information. Although the test is marked Fail because of the forced stop, the performance data in the test is still valid. However, if it does not matter to your application if data is reused, the default of wrapping is more convenient. With wrapping, you need not ensure that your datapool is large enough when you change the workload by adding more users or increasing the iteration count in a loop.

    Anmerkung: Diese Option steht bei Auswahl der Option Wahlfrei nicht zur Verfügung, da bei einem wahlfreien Zugriff nie das Ende der Datei erreicht wird.
    Nur einmal pro Benutzer abrufen

    By default, one row is retrieved from the datapool for each execution of a test, and the data in the datapool row is available to the test only for the duration of the test. Select Fetch only once per user to specify that every access of the datapool from any test being run by a particular virtual user will always return the same row.

    To illustrate how these options affect the rows that are returned, assume that a test contains a loop which accesses a datapool. The loop has 2 iterations. The following table shows the row that is accessed in each iteration:
    Datapool option Iteration 1 Iteration 2
    Sequential and Private row 1 row 2
    Shared and Shuffled row x row y
    Fetch only once per user row x row x
  7. Wenn Sie einen voll funktionsfähigen Datenpool erstellen, können Sie die Daten in dieser Sitzung auch aus einer CSV-Datei importieren. Sie können Daten jedoch auch später importieren, indem Sie auf Datei > Importieren > Test > Datenpool klicken und dann eine CSV-Datei auswählen. Weitere Informationen zum Importieren von Datenpools finden Sie unter CSV-Datei in einen Datenpool importieren.

Nächste Schritte

Nachdem Sie einen Datenpool erstellt und diesem Daten hinzugefügt haben, muss in einem nächsten Schritt ein Wert im Test einer Spalte im Datenpool zugeordnet werden (siehe Wert in einem Test einer Datenpoolspalte zuordnen).

Feedback