What are DataSources
The Datasources functionality has two input methods:
Method 1: Create a datasource text file, that when selected can generate text in your flow for a set amount of time or a set amount of words. You can randomize the output.
Method 2: Create a datasource sheet file, you can create a sheet file and implement if you wish rows or specific words from a column, e.g. password that is linked to a specific user.
Method 1: Create a datasource text file, that when selected can generate text in your flow for a set amount of time or a set amount of words. You can randomize the output.
Method 2: Create a datasource sheet file, you can create a sheet file and implement if you wish rows or specific words from a column, e.g. password that is linked to a specific user.
Implementing DataSource Text
Below is a step-by-step guide on how to implement a DataSource text in your flow.
- Open LoadGen Studio and open the LoadGen Recorder.
- In the Toolbox in the section User simulation, you have to Send DataSource Text
- Click on Send DataSource text, the first time you use this functionality you will get a message no DataSource available, click Yes to create one.
- Give the DataSource a name and select if you want to add a DataSource sheet or TextBlock. In this example select TextBlock, and click OK.
- A new window opens with your DataSource name, in the section Textblock add the text you want to add. In the example, we have added a random lorem ipsum. Click OK when you are happy with your text.
- Now you will need to define your textblock properties.
- First, you need to decide between input based on time or input based on word count.
- When selecting the time, please set the amount of time you want the text to type automatically.
- Last you need to decide if you want the lines in your text file to be random or not.
Input based on time
When selecting time, the input will finish after the time has elapsed, but not before finishing typing the last word.
Input based on word count
When selecting word count, please set the number of words you want the datasource to type. You need to decide if you want the lines in your text file to be random or not.
Text Input
The time or amount of text that is typed depends on your tempo settings:
- Click OK and your DataSource Text will be added to your flow.
Implementing DataSource Sheet
Below is a step-by-step guide on how to implement a DataSource Sheet in your flow.
- Open LoadGen Studio and open the LoadGen Recorder.
- In the Toolbox in the section User simulation, you have to Send DataSource Text.
- When you click Send DataSource Text in the Toolbox select the datasource you already created. If you don't have a datasource, click on Create.
- Next step is to give the DataSource a name and select if you want to add a DataSource sheet or TextBlock, in this case, select Scheet, and click OK.
- You can now create a Datasource sheet.
- Add more columns with the plus and minus signs.
- For this example, we have created a sheet with users, user names, and passwords. When completed click OK.
- A new window will open, your Filter Editor.
- You can specify your filter in the first box, you also need to specify the result in the bottom window.
- For the example we have filtered our search for name equals user1 and in specifying the result we have added Password.
- As you can see the password will be highlighted green, if this is the expected result click OK and the DataSource will be added to your flow.
Edit existing DataSources
When you have DataSources in your flow you can edit them in the following Location
- Go to LoadGen Studio Main window, click in General simulation flow on Start, you should see a similar window as below.
- Click on the right of the screen, on the tab page Repository:
- This will open a new Tab with Useraction blocks and DataSources
Refresh your DataSource
You might need to refresh your datasources to see your last added datasource:
Here you are able to edit delete and add DataSources. You also have the option to import and export DataSources.
Store information from a DataSource into a variable
If you have a sheet with multiple columns you create a filter, return an item of a particular column and store this in a variable. You can reuse the variable to retrieve the information of a specific column of the selected - filtered - row based on the variable content.
In the following steps, we explain how you can reuse your selected row from a variable:
- The first step is to drag and drop the Variable user action to your Application Block sequence, start by clicking the following item:
- Select Adjust the value of a variable.
- Select the variable you want to store your retrieved Data Source text into.
- If you don't have a text variable, you can create one by clicking the Add a new variable button.
- Now click the Add an item, or in case you want to edit a previously created DataSource just double click the DataSource item.
- Just make sure you remove the default filter item by clicking the item in the first filter row.
- Now select the radio box: Return 1 row at random.
- On the far right drag and drop the correct column name to the Specify the result text box, this value will be returned and stored into the variable.
- Press OK.
- The result will be displayed in the next step in the wizard, if you want to edit the value, just double-click just created row.
- The next step is to send another column (or multiple columns) of the selected (randomly chosen) row to the session. Start with dragging the user action Send DataSource text to the Application Block sequence:
- First choose the correct DataSource (if this is a different one you used in the steps above, make sure your sheet contains the stored variable content).
- In the filter choose the correct variable which you defined in the above steps.
- A form will pop up asking you to enter an expected value of the variable, in this example we use testuser1 which corresponds with a value in the Name column.
- Press the Apply Filter, you will see one row is filtered in the Result view.
- On the far right drag and drop the correct column name to the Specify the result text box, this value will be sent to the session.
- Press OK.
- Your Application Block sequence will show two user actions. Off course you're free to place these items throughout your workload. Be sure to set the variable first.