CloudTest supports database-backed Seed Data, which enables users to execute a database query from within a Seed Data Repository object in order to utilize retrieved query data as seed data. When you run a load test, this query to the database will occur once (and only once) to make sure you have 'fresh' data for the loadtest. Users wishing to interact with databases in a more dynamic way should investigate CloudTest's Direct to Database Testing feature.
Once retrieved, the database-backed seed data can be utilized in your test just as any other seed data can be. For more about this important topic, refer to any of the following CloudLink, KnowledgeBase topics:
- Seed Data in Clip Properties
- Seed Data in Track Properties
- Seed Data in Container, Message, or Action Properties
- Seed Data – Unique Values Changing from Iteration to Iteration
Users can setup a Seed Data: Repository database connection using the Seed Data Wizard and the following steps.
- Launch the Seed Data Wizard using Central > Seed Data, New.
The Seed Data Wizard's Name, Description, and Method page appears.
- To define a JDBC connection, select the Execute a database query button, and then click Next.
The Definition and Edit page appears. You can opt to enter the pertinent information using either the Basic or Advanced tab of the Seed Data Wizard.
- Use the Basic tab if you'd like the Seed Data Wizard to construct the JDBC URL for you. The resulting URL will be based on the information you provide.
- Use the Advanced tab if you are a power user and already know the JDBC URL to use. Additionally, note that the Advanced tab also accepts additional query parameters that advanced users may want to provide in some cases. If you are such a user, you can paste the pertinent JDBC URL into the Advanced tab JDBC URL field, and then move on to defining the Seed Data retrieval query to use (see Step 9 below).
- For basic users, select the type of RDBMS to use.
These are limited to the currently supported databases PostgreSQL, Oracle, and SQL Server. The currently supported RDBMS versions are:
- Oracle (versions: 11.2.0, 11.1.0, 10.2.0, 10.1.0, 9.2.0, 9.0.1)
- Microsoft SQL Server (versions: SQL Server 2012, SQL Server 2008 R2, SQL Server 2008, SQL Server 2005, SQL Azure)
- PostgreSQL (versions: 7.2 or newer)
- Enter the host name of your RDBMS. For example, localhost, if the database resides on the same machine. Otherwise, specify it by IP address or domain.
- Enter the port in use for the given host name. This is database specific. For example, 5432 for a default PostgreSQL installation.
- Enter the Catalog name. For example, soasta_maestro_database_testing.
- Enter the RDBMS User Name and Password. In our example, we are using the PostgreSQL username SOASTA_DOC.
- Check Use SSL, if required for your RDBMS connection.
As noted above, the Basic tab will construct the JDBC URL for your database type based on the information that you provided in the steps above.
Note that the following syntaxes are used for the given database type:
A PostgreSQL database requires the following Database URL format:
A Microsoft SQL Server database requires the following Database URL format:
The database name is specified by the property "databaseName".
An Oracle database requires the following Database URL format:
- Finally, enter the Seed Data retrieval query. This query should get the data to use as seed data. Some common examples include:
- After entering your Seed Data retrieval query, click the Test button to execute your query. When you do so, if the query is successful, the results of your query are posted to the table below the Test button (as shown below).
The last example above is used in the following examples.
For the Basic tab:
For the Advanced tab: