Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Note: Checklist can be edited in (Create > Edit Data Base Checklist). After editing, the
test should be executed in ‘Update’ mode before running in the ‘Verify’ mode.
}
ddt_close(table);
5. Statements created using Data Driver Wizard on importing data from the data base:
table = "default.xls";
rc = ddt_open(table, DDT_MODE_READWRITE);
if (rc!= E_OK && rc != E_FILE_OPEN)
pause("Cannot open table.");
ddt_update_from_db(table, "msqr1.sql", out_rows_count);
ddt_save(table);
ddt_get_row_count(table,table_RowCount);
for(table_Row = 1; table_Row <= table_RowCount; table_Row ++)
{
ddt_set_row(table,table_Row);
}
ddt_close(table);
}
ddt_close(table);
Statements created on selecting the option ‘Import data from data base’:
table = "default.xls";
rc = ddt_open(table, DDT_MODE_READWRITE);
if (rc!= E_OK && rc != E_FILE_OPEN)
pause("Cannot open table.");
ddt_update_from_db(table, "msqr1.sql", out_rows_count);
ddt_save(table);
ddt_get_row_count(table,table_RowCount);
for(table_Row = 1; table_Row <= table_RowCount; table_Row ++)
{
ddt_set_row(table,table_Row);
set_window ("ThunderRT6FormDC_1", 2);
list_select_item ("ThunderRT6ComboBox_13", "KGH -173");
password_edit_set("ThunderRT6TextBox_2", "gz");
button_press ("OK_1");
}
ddt_close(table);
8. Types of Synchronization:
a. Object/Window Synchronization: When want Winrunner to wait for an object/window to
appear.
b. Property value Synchronization: When want Winrunner to wait for an object/window to
have a specific property. (wait_info such as button_wait_info, list_wait_info,
edit_wait_info)
c. Bitmap Synchronization: When want Winrunner to wait for a bitmap of an
object/window or an area of a screen. (Win_wait_bitmap, obj_wait_bitmap)
b. db_disconnect: disconnects from the database and ends the database session.
Syntax:
db_disconnect ( session_name );
session_name: The logical name of the database session.
c. db_execute_query: executes the query based on the SQL statement and creates a
record set.
Syntax:
db_execute_query ( session_name, SQL, record_number );
session_name: The logical name of the database session.
SQL: The SQL statement.
record_number: An out parameter returning the number of records in the result query.
e. db_get_headers: returns the number of column headers in a query and the content of
the column headers, concatenated and delimited by tabs.
Syntax:
db_get_headers ( session_name, header_count, header_content );
session_name: The logical name of the database session.
header_count: The number of column headers in the query.
header_content:The column headers concatenated and delimited by tabs. Note that if this
string exceeds 1024 characters, it is truncated.
f. db_get_row: returns the content of the row, concatenated and delimited by tabs.
Syntax:
db_get_row ( session_name, row_index, row_content );
session_name: The logical name of the database session.
row_index: The numeric index of the row. (The first row is always numbered "0".)
row_content: The row content as a concatenation of the fields values, delimited by
tabs.
h. db_write_records: writes the record set into a text file delimited by tabs.
Syntax:
db_write_records ( session_name, output_file [ , headers [ , record_limit ] ] );
session_name: The logical name of the database session.
output_file: The name of the text file in which the record set is written.
Headers: An optional Boolean parameter that will include or exclude the column
headers from the record set written into the text file.
record_limit: The maximum number of records in the record set to be written into the
text file. A value of NO_LIMIT (the default value) indicates there is no
maximum limit to the number of records in the record set.
12. TSL functions related to Data Table created using Data Driver Wizard:
a. ddt_open: creates or opens a data table file so that WinRunner can access it.
Syntax:
ddt_open ( data_table_name [ , mode ] );
data_table_name: The name of the data table. The name may be the table variable
name, the Microsoft Excel file or a tabbed text file name, or the
full path and file name of the table.The first row in the file
contains the names of the parameters. This row is labeled row 0.
Mode: The mode for opening the data table: DDT_MODE_READ (read-
only) or DDT_MODE_READWRITE (read or write). When the
mode is not specified, the default mode is DDT_MODE_READ.
b. ddt_export: exports the information of one data table file into a different data table file.
Syntax:
ddt_export ( data_table_namename1, data_table_namename2 );
data_table_namename1: The source data table filename.
data_table_namename2: The destination data table filename.
c. ddt_get_current_row: retrieves the active row of a data table.
Syntax:
ddt_get_current_row ( data_table_name, out_row );
data_table_name: The name of the data table. The name may be the table variable
name, the Microsoft Excel file or a tabbed text file name, or the
full path and file name of the table. The first row in the file
contains the names of the parameters. This row is labeled row 0.
out_row: The output variable that stores the active row in the data table.
Note: When the data table is first opened, the active row is row 1.
g. ddt_next_row: changes the active row in a data table to the next row.
Syntax:
ddt_next_row ( data_table_name );
data_table_name: The name of the data table. The name may be the table variable
name, the Microsoft Excel file or a tabbed text file name, or the
full path and file name of the table.The first row in the file
contains the names of the parameters.
Note: If the active row is the last row in a data table, then the E_OUT_OF_RANGE value
is returned.
h. ddt_report_row: reports the active row in a data table to the test results.
Syntax:
ddt_report_row ( data_table_name );
data_table_name: The name of the data table. The name may be the table variable
name, the Microsoft Excel file or a tabbed text file name, or the
full path and file name of the table. The first row in the file
contains the names of the parameters. This row is labeled row 0.
Note: When the data table is first opened, the active row is the first row.
o. ddt_val: returns the value of a parameter in the active row in a data table.
Syntax:
ddt_val ( data_table_name, parameter );
data_table_name: The name of the data table. The name may be the table variable
name, the Microsoft Excel file or a tabbed text file name, or the
full path and file name of the table. The first row in the file
contains the names of the parameters.
Parameter: The name of the parameter in the data table.
p. ddt_val_by_row: returns the value of a parameter in the specified row in a data table.
Syntax:
ddt_val_by_row ( data_table_name, row_number, parameter );
data_table_name: The name of the data table. The name may be the table variable
name, the Microsoft Excel file or a tabbed text file name, or the
full path and file name of the table. The first row in the file
contains the names of the parameters. This row is labeled row 0.
row_number: The number of the row in the data table.
Parameter: The name of the parameter in the data table.
c. GUI checkpoint > For Multiple objects: Checks for multiple properties of multiple
Objects
Syntax:
win_check_gui ( window, checklist, expected_results_file, time );
compares current GUI data to expected GUI data for a window.
window: The logical name of the window.
Checklist: The name of the checklist specifying the checks to perform.
expected_results_file:The name of the file storing the expected GUI data.
Time: The time is added to the timeout test option to give the
maximum interval between the previous input even and
the screen capture.
Note: Checklist can be edited in (Create > Edit GUI Checklist). After editing the checklist, the
test should be executed in ‘Update’ mode before running in the ‘Verify’ mode.
Syntax:
obj_check_bitmap: compares an object bitmap to an expected bitmap
obj_check_bitmap ( object, bitmap, time);
object: The logical name of the GUI object. The object may belong to any class.
Bitmap: A string expression that identifies the captured bitmap.
Time:The interval, which is added to the timeout_msec testing option, marking
the maximum delay between the previous input event and the capture of
the current bitmap, in seconds during the test run.
17. Which screen will be opened when the WinRunner cannot identify an object during the
test run?
A Run Wizard will be opened with a hand icon to show the corresponding object, and the
test can be continued.
Merging Modes:
a. Auto Merge
The merge tool merges the files automatically. If conflict exists between the
merging files, the conflicts are highlighted and prompted to resolve them.
b. Manual Merge:
GUI objects have to be added to the target file manually. The merge tool does not
highlight conflicts between the files.
In both the modes, the merge tool prevents from creating the conflicts while
merging the files.
19. Steps in changing the ‘GUI map file per test mode’:
a. Merging the GUI files.
b. Modify the test to load the appropriate the GUI files.
c. Click the ‘Global GUI Map File’ in the ‘GUI Map File Mode’ box in the
‘Environment’ tab of the ‘General’ options dialog box.
# ThunderRT6FormDC
set_window ("ThunderRT6FormDC", 1);
button_set ("Referring", ON);
obj_type ("Referring","<kTab>");
button_press ("...");
set_window("ThunderRT6FormDC", 1);
obj_get_text("FPSpreadADO.fpSpread.2", RAvailableDate, 42, 26, 160, 47);
obj_get_text("FPSpreadADO.fpSpread.2", RFromTime, 162, 25, 259, 48);
obj_get_text("FPSpreadADO.fpSpread.2", RToTime, 257, 25, 355, 50);
if(RAvailableDate =="" && RFromTime =="" && RToTime =="")
{
# ThunderRT6FormDC
set_window ("ThunderRT6FormDC", 1);
obj_get_text("Date Time_0", RFromDate, 1, 2, 61, 19);
Rday=substr(RFromDate,1,2);
Rmonth=substr(RFromDate,4,2);
Ryear=substr(RFromDate,7,4);
Rdate=Rday&Rmonth&Ryear;
obj_type ("FPSpreadADO.fpSpread.2",Rdate);
obj_mouse_click ("FPSpreadADO.fpSpread.2", 188, 38, LEFT);
obj_type ("FPSpreadADO.fpSpread.2","0");
obj_type ("SPR32A30Time","900am");
obj_mouse_drag ("FPSpreadADO.fpSpread.2", 275, 39, 275, 38, LEFT);
obj_type ("FPSpreadADO.fpSpread.2","0");
obj_type ("SPR32A30Time","530pm");
button_press ("Save");
# KGH FRONT OFFICE
set_window ("KGH FRONT OFFICE", 10);
button_press ("OK");
}
else
{
# ThunderRT6FormDC
set_window ("ThunderRT6FormDC", 0);
button_press ("Save");
}
# ThunderRT6FormDC
set_window ("ThunderRT6FormDC", 0);
button_press ("Cancel");
# Front Office
set_window ("Front Office", 0);
button_press ("Yes");
}
else
{
# ThunderRT6FormDC
set_window ("ThunderRT6FormDC", 1);
button_press ("Save");
# ThunderRT6FormDC
set_window ("ThunderRT6FormDC", 1);
button_set ("Referring", ON);
obj_type ("Referring","<kTab>");
button_press ("...");
set_window("ThunderRT6FormDC", 1);
obj_get_text("FPSpreadADO.fpSpread.2", RAvailableDate, 42, 26, 160, 47);
obj_get_text("FPSpreadADO.fpSpread.2", RFromTime, 162, 25, 259, 48);
obj_get_text("FPSpreadADO.fpSpread.2", RToTime, 257, 25, 355, 50);
if(RAvailableDate =="" && RFromTime =="" && RToTime =="")
{
# ThunderRT6FormDC
set_window ("ThunderRT6FormDC", 1);
obj_get_text("Date Time_0", RFromDate, 1, 2, 61, 19);
Rday=substr(RFromDate,1,2);
Rmonth=substr(RFromDate,4,2);
Ryear=substr(RFromDate,7,4);
Rdate=Rday&Rmonth&Ryear;
obj_type ("FPSpreadADO.fpSpread.2",Rdate);
obj_mouse_click ("FPSpreadADO.fpSpread.2", 188, 38, LEFT);
obj_type ("FPSpreadADO.fpSpread.2","0");
obj_type ("SPR32A30Time","900am");
obj_mouse_drag ("FPSpreadADO.fpSpread.2", 275, 39, 275, 38, LEFT);
obj_type ("FPSpreadADO.fpSpread.2","0");
obj_type ("SPR32A30Time","530pm");
button_press ("Save");
# KGH FRONT OFFICE
set_window ("KGH FRONT OFFICE", 10);
button_press ("OK");
}
else
{
# ThunderRT6FormDC
set_window ("ThunderRT6FormDC", 0);
button_press ("Save");
}
# ThunderRT6FormDC
set_window ("ThunderRT6FormDC", 0);
button_press ("Cancel");
# Front Office
set_window ("Front Office", 0);
button_press ("Yes");
}
------------------------------------------------------------------------------------------------
# Checks whether OP New Patients exist
# If OP New Patients does not exist
if(win_exists("Front Office")==E_OK)
{
set_window ("Front Office", 0);
button_press ("OK");
report_msg("No OP New Patients");
}
# If OP New Patients Exist
else
{
tbl_get_rows_count("MSFlexGridLib.MSFlexGrid.1",New);
start_transaction("OPNew");
button_set ("Review", ON);
end_transaction("OPNew");
if(win_exists("Front Office")==E_OK)
{
set_window ("Front Office", 0);
button_press ("OK");
}
else
{
}
report_msg("Total OP New Patients="&New);
}