![]() | ![]() | Application Development |
You can call Prolifics functions from within QA Partner®. QA Partner, part of the QualityWorks
software testing program manufactured by Segue Software Incorporated, can be used to automate functional and regression testing in client/server applications.
With the interface, you can get and set property values for widgets and screens using QA Partner methods. The interface also includes methods to get and set information about grid widgets and their members. All the Prolifics constants that are available in JPL are also available in this interface.
The following table lists the basic methods available in the interface, their associated Prolifics C functions (if available), and a description of each method. If the method has a corresponding Prolifics function, the parameters in the method will be identical to the parameters in the function, except for the Prolifics object identifier. Since the syntax used to call methods in QA Partner contains the name of the widget and/or screen, it is not necessary to specify the Prolifics object identifier as one of the method's parameters. For example, the method specification for finding the current row in a grid is as follows:
rowNumber = screenName.gridName.get_current_row()
The following section lists the method, the method description, and its type and number of parameters.
get_cell_text
string = get_cell_text (integer iRow, integer iCol)
get_column_count
number = get_column_count ()
get_column_name
string = get_column_name (integer iCol)
get_current_column
string = get_current_column ()
get_current_row
number = get_column_count ()
get_onscreen_row_count
number = get_onscreen_row_count ()
get_row_text
string = get_row_text (integer iRow)
get_total_row_count
number = get_total_row_count ()
get_sm_base
SMBASE variable.
string = get_sm_base ()
is_cell_empty
boolean = is_cell_empty (integer iRow, integer iCol)
prop_error
string = prop_error ()
prop_get*
number = prop_get_int (integer iProp)
string = prop_get_str (integer iProp)
number = prop_get_dbl (integer iProp)
number = prop_get_m_int (integer iProp, integer iPropItem)
string = prop_get_m_str (integer iProp, integer iPropItem)
number = prop_get_m_dbl (integer iProp, integer iPropItem)
number = prop_get_x_int (integer iArrayItem, integer iProp)
string = prop_get_x_str (integer iArrayItem, integer iProp)
number = prop_get_x_dbl (integer iArrayItem, integer iProp)
prop_set*
error = prop_set_int (integer iProp, integer iValue)
error = prop_set_str (integer iProp, string sValue)
error = prop_set_dbl (integer iProp, real rValue)
error = prop_set_m_int (integer iProp, integer iPropItem,
integer iValue)
error = prop_set_m_str (integer iProp, integer iPropItem,
string sValue)
error = prop_set_m_dbl (integer iProp, integer iPropItem,
real rValue)
error = prop_set_x_int (integer iArrayItem, integer iProp,
interger iValue)
error = prop_set_x_str (integer iArrayItem, integer iProp,
string sValue)
error = prop_set_x_dbl (integer iArrayItem, integer iProp,
real rValue)
set_cell_text
error = set_cell_text (integer iRow, integer iCol, string
sValue)
set_current_cell
error = set_current_cell (integer iRow, integer iCol)
set_current_row
error = set_current_row (integer iRow)
The following methods are wrappers to the basic methods and can also be called in the interface:
Example | ![]() |
Samples of the interface can be found in SMBASE/samples/qapartner. The following section is taken from the vbiz.t file.
[+] testcase MovieSearchByName() appstate CustLogin
[ ] Window wVl = VideoSearch.VidList
[ ]
[ ] // Make sure the Database.Use in Where property
[ ] // is set to YES and the Database.
[ ] // Use in Where.Operator property is set to like%
[ ] Verify(VideoSearch.Title.prop_get_int(PR_USE_IN_WHERE),
PV_YES, "Use in Where property")
[ ] Verify(VideoSearch.Title.prop_get_int(PR_WHERE_OPERATOR),
PV_WHERE_LIKE_R, "Where Operator property")
[ ]
[ ] // search for movies with a first word of "All"
[ ] VideoSearch.Title.SetText("All")
[ ] VideoSearch.Search.Click()
[ ]
[ ] // Make sure only 4 rows were retrieved. If there's
[ ] // ever more we want the test to fail.
[ ] wVl.VerifyNumRows(4)
[ ]
[ ] // The following assertion is intended to be
[ ] // VerifyCellTrim rather than VerifyRowTrim.
[ ] wVl.VerifyCellTrim(1, 1, "3")
[ ] wVl.VerifyCellTrim(1, 2, "All of Me")
[ ] wVl.VerifyCellTrim(1, 3, "Carl Reiner")
[ ] wVl.VerifyCellTrim(1, 4, "COM")
[ ] wVl.VerifyCellTrim(1, 5, "PG")
[ ]