Software QA FYI - SQAFYI

Mercury WinRunner FAQ

Part:   1  2  3  4  5  6  7  8  9  10  11  12  13  14  15  16  17  18  19   20  21  22  23  24  25  26  27  28  29  30  31  32  33  34  35  36  37  38  39  40  41  42  43  44  45 

Q:What check points you will use to read and check text on the GUI and explain its syntax?

  • You can use text checkpoints in your test scripts to read and check text in GUI objects and in areas of the screen. While creating a test you point to an object or a window containing text. WinRunner reads the text and writes a TSL statement to the test script. You may then add simple programming elements to your test scripts to verify the contents of the text.
  • You can use a text checkpoint to:
    • Read text from a GUI object or window in your application, using obj_get_text and win_get_text
    • Search for text in an object or window, using win_find_text and obj_find_text
    • Move the mouse pointer to text in an object or window, using obj_move_locator_text and win_move_locator_text
    • Click on text in an object or window, using obj_click_on_text and win_click_on_text

Q:How to get Text from object/window ?

We use obj_get_text (logical_name, out_text) function to get the text from an object
We use win_get_text (window, out_text [, x1, y1, x2, y2]) function to get the text from a window.


Q:How to get Text from screen area ?

We use win_get_text (window, out_text [, x1, y1, x2, y2]) function to get the text from a window.


Q:Which TSL functions you will use for Searching text on the window

find_text ( string, out_coord_array, search_area [, string_def ] );
win_find_text ( window, string, result_array [, search_area [, string_def ] ] );


Q:What are the steps of creating a data driven test?

The steps involved in data driven testing are:
Creating a test
Converting to a data-driven test and preparing a database
Running the test
Analyzing the test results.


Q: How to use data driver wizard?

You can use the DataDriver Wizard to convert your entire script or a part of your script into a data-driven test. For example, your test script may include recorded operations, checkpoints, and other statements that do not need to be repeated for multiple sets of data. You need to parameterize only the portion of your test script that you want to run in a loop with multiple sets of data.

To create a data-driven test:

  • If you want to turn only part of your test script into a data-driven test, first select those lines in the test script.
  • Choose Tools - DataDriver Wizard.
  • If you want to turn only part of the test into a data-driven test, click Cancel. Select those lines in the test script and reopen the DataDriver Wizard. If you want to turn the entire test into a data-driven test, click Next.
  • The Use a new or existing Excel table box displays the name of the Excel file that WinRunner creates, which stores the data for the data-driven test. Accept the default data table for this test, enter a different name for the data table, or use
  • The browse button to locate the path of an existing data table. By default, the data table is stored in the test folder.
  • In the Assign a name to the variable box, enter a variable name with which to refer to the data table, or accept the default name, table.
  • At the beginning of a data-driven test, the Excel data table you selected is assigned as the value of the table variable. Throughout the script, only the table variable name is used. This makes it easy for you to assign a different data table
  • To the script at a later time without making changes throughout the script.
  • Choose from among the following options:
    1. Add statements to create a data-driven test: Automatically adds statements to run your test in a loop: sets a variable name by which to refer to the data table; adds braces ({and}), a for statement, and a ddt_get_row_count statement to your test script selection to run it in a loop while it reads from the data table; adds ddt_open and ddt_close statements
    2. To your test script to open and close the data table, which are necessary in order to iterate rows in the table. Note that you can also add these statements to your test script manually.
    3. If you do not choose this option, you will receive a warning that your data-driven test must contain a loop and statements to open and close your datatable.
    4. Import data from a database: Imports data from a database. This option adds ddt_update_from_db, and ddt_save statements to your test script after the ddt_open statement.
    5. Note that in order to import data from a database, either Microsoft Query or Data Junction must be installed on your machine. You can install Microsoft Query from the custom installation of Microsoft Office. Note that Data Junction is not automatically included in your WinRunner package. To purchase Data Junction, contact your Mercury Interactive representative. For detailed information on working with Data Junction, refer to the documentation in the Data Junction package.
    6. Parameterize the test: Replaces fixed values in selected checkpoints and in recorded statements with parameters, using the ddt_val function, and in the data table, adds columns with variable values for the parameters. Line by line: Opens a wizard screen for each line of the selected test script, which enables you to decide whether to parameterize a particular line, and if so, whether to add a new column to the data table or use an existing column when parameterizing data.
    7. Automatically: Replaces all data with ddt_val statements and adds new columns to the data table. The first argument of the function is the name of the column in the data table. The replaced data is inserted into the table.
  • The Test script line to parameterize box displays the line of the test script to parameterize. The highlighted value can be replaced by a parameter. The Argument to be replaced box displays the argument (value) that you can replace with a parameter. You can use the arrows to select a different argument to replace.
    Choose whether and how to replace the selected data:
    1. Do not replace this data: Does not parameterize this data.
    2. An existing column: If parameters already exist in the data table for this test, select an existing parameter from the list.
    3. A new column: Creates a new column for this parameter in the data table for this test. Adds the selected data to this column of the data table. The default name for the new parameter is the logical name of the object in the selected. TSL statement above. Accept this name or assign a new name.
  • The final screen of the wizard opens.
    1. If you want the data table to open after you close the wizard, select Show data table now.
    2. To perform the tasks specified in previous screens and close the wizard, click Finish.
    3. To close the wizard without making any changes to the test script, click Cancel.

Part:   1  2  3  4  5  6  7  8  9  10  11  12  13  14  15  16  17  18  19   20  21  22  23  24  25  26  27  28  29  30  31  32  33  34  35  36  37  38  39  40  41  42  43  44  45 

Mercury WinRunner FAQ