|
1)
How do you create ODBC query?
a)
We can create ODBC query using the
database checkpoint wizard. It provides with option to create an SQL file that
uses an ODBC DSN to connect to the database. The SQL File will contain the
connection string and the SQL statement.
2)
How do you record a data driven test?
a)
We can create a data-driven testing
using data from a flat file, data table or a database.
i.
Using Flat File: we actually
store the data to be used in a required format in the file. We access the file
using the File manipulation commands, reads data from the file and assign the
variables with data.
ii.
Data Table: It is an excel
file. We can store test data in these files and manipulate them. We use the ‘ddt_*’
functions to manipulate data in the data table.
iii.
Database: we store test data in
the database and access these data using ‘db_*’ functions.
3)
How do you convert a database file to a text file?
a)
You can use Data Junction to create
a conversion file which converts a database to a target text file.
4)
How do you parameterize database check points?
a)
When you create a standard database
checkpoint using ODBC (Microsoft Query), you can add parameters to an SQL
statement to parameterize the checkpoint. This is useful if you want to create a
database checkpoint with a query in which the SQL statement defining your query
changes.
5)
How do you create parameterize SQL commands?
a)
A parameterized query is a query in
which at least one of the fields of the WHERE clause is parameterized, i.e., the
value of the field is specified by a question mark symbol ( ? ). For example,
the following SQL statement is based on a query on the database in the sample
Flight Reservation application:
i.
SELECT Flights.Departure,
Flights.Flight_Number, Flights.Day_Of_Week FROM Flights Flights WHERE (Flights.Departure=?)
AND (Flights.Day_Of_Week=?)
SELECT defines the columns to include in
the query.
FROM specifies the path of the database.
WHERE (optional) specifies the conditions, or
filters to use in the query.
Departure is the parameter that represents the
departure point of a flight.
Day_Of_Week is the parameter that
represents the day of the week of a flight.
b)
When creating a database
checkpoint, you insert a db_check statement into your test script. When you
parameterize the SQL statement in your checkpoint, the db_check function
has a fourth, optional, argument: the parameter_array argument. A
statement similar to the following is inserted into your test script:
db_check("list1.cdl", "dbvf1", NO_LIMIT,
dbvf1_params);
The parameter_array argument will
contain the values to substitute for the parameters in the parameterized
checkpoint.
|