Database-Backed Seed Data
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.
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
- 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.
jdbc:postgresql://< database _server_host>:<port_number>/< database _name>Note: Refer to the PostgreSQL online documentation for more details.A Microsoft SQL Server database requires the following Database URL format:
jdbc:sqlserver://[databaseServerHost[\databaseInstanceName][:portNumber]][;<property>=value[;<property=value>]] <property=value>]]The database name is specified by the property "databaseName".Note: Refer to the Microsoft online documentation for more details.An Oracle database requires the following Database URL format:
jdbc:oracle:thin:@:<port_number>:< database _name>Note: Refer to the Oracle database documentation for more information.
- Finally, enter the Seed Data retrieval query. This query should get the data to use as seed data. Some common examples include:
SELECT * FROM serverclassOr,
SELECT * FROM serverclass order by idOr,
SELECT * FROM __seed_data__ where column_1 like 'Seed Data Object 005D%;'
- 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).
What you should see
The last example above is used in the following examples.
For the Basic tab:
For the Advanced tab: